User Tools

Site Tools


can_i_use_dci_in_java

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

can_i_use_dci_in_java [2014/01/20 08:59]
gazoot
can_i_use_dci_in_java [2016/02/24 13:01] (current)
mbrowne grammatical fixes
Line 1: Line 1:
 ====== Can I use DCI in Java? ====== ====== Can I use DCI in Java? ======
-At runtime (program execution), DCI is about attaching and detaching RoleMethods to objects. This makes it tricky to implement DCI in any statically typed language, however many of those languages have features to make it look like a type has other member methods than what's defined in its class or structure:+At runtime (program execution), DCI is about attaching and detaching RoleMethods to objects, while [[Why isn't it DCI if you use a wrapper object to represent the Role?​|preserving object identity]]. This makes it tricky to implement DCI in any statically typed language, however many of those languages have features to make it look like a type has other member methods than what's defined in its class or structure:
  
   * C# has [[http://​en.wikipedia.org/​wiki/​Extension_method|extension methods]]   * C# has [[http://​en.wikipedia.org/​wiki/​Extension_method|extension methods]]
   * C++ has [[http://​en.wikipedia.org/​wiki/​Template_(C%2B%2B)|templates]]   * C++ has [[http://​en.wikipedia.org/​wiki/​Template_(C%2B%2B)|templates]]
-  * Haxe has a powerful [[http://​en.wikipedia.org/​wiki/​Type_inference|type inference]]+  * Haxe has a powerful [[http://​en.wikipedia.org/​wiki/​Type_inference|type inference]] ​and [[http://​haxe.org/​manual/​macros|macros]] (compile-time code generation)
  
-Unfortunately Java has nothing similar to those features, making a true DCI implementation impossible in the current version of the language. All is not lost howeverboth Scala and Qi4j generates ​Java object code and has a fully working DCI implementation. Check the [[Existing DCI Implementations]] page for links.+Unfortunately Java has nothing similar to those features, making a true DCI implementation impossible in the current version of the language. There is simply no clean way to separate what the system is from what it does in Java. All is not lost howeverboth Scala and Qi4j generate ​Java object code and have a fully working DCI implementation. Check the [[Existing DCI Implementations]] page for links.
can_i_use_dci_in_java.1390208359.txt.gz ยท Last modified: 2014/01/20 08:59 by gazoot