Running pure DCI is tough in most languages, and you usually run into one of two problems. Statically typed languages, such as Java, usually end up with some kind of wrapping solution that creates a problem for self schizofrenia . Dynamic languages, which allow you to attach new instance methods of your choice at runtime, often suffer from problems with defining scope. RoleMethods functions are still available when the object no longer plays a role.
The best option I know for different languages
- Marvin: Design for DCI and, as such, has full support.
- Cut with the help of Maroon. If you use maroon gem (or similar), then there is full DCI support in Ruby.
- Java: Qi4J
- C # Extension methods (constraint problem and overload problem), possibly together with dynamic ones. I had a Clay based implementation, but this creates an authentication problem
- Native Ruby: injection method. Oscillogram with methods available when the object no longer plays a role.
- C ++: Templates. The lifespan of the method for determining the scale coincides with the lifespan
if you look at fullOO you will find examples in several languages. Including in my own project Marvin, which is a language specifically designed to support DCI. Currently, most of Marvin is identical to C #, so you can say that the extension to C # is more than its own language.
source share