Content deleted Content added
Tag: references removed |
|||
Line 71:
Implementation techniques differ across programming languages. What is common to many approaches is that Roles are represented by such constructs as generics, templates, classes, or [[Traits (computer science)|traits]]. Code for the basic ___domain logic is implemented separately, following conventional object-oriented practice and most commonly using classes. Each Role's code is injected into the ___domain object that will play it during the [[use case]] enactment. To implement [[Role-oriented programming|Roles]], [[method injection]] is usually needed. [[Traits (computer science)|Traits]]<ref>Nathaniel Schärli et al. Traits: Composable units of behavior. http://scg.unibe.ch/archive/papers/Scha03aTraits.pdf</ref> are one common programming language technique to support [[method injection]]. Some languages, such as [[Scala (programming language)|Scala]], have native support for [[Traits (computer science)|traits]], while other languages (e.g., [[Ruby (programming language)|Ruby]] and [[Python (programming language)|Python]]) allow run time injection of methods. In [[Java (programming language)|Java]], pre-compiler tricks based on annotations are needed to support DCI.
Several example implementations exist: [[Smalltalk]]-[[Squeak]],<ref>The Common Sense of Object Oriented Programming by Trygve Reenskaug, http://heim.ifi.uio.no/~trygver/2009/commonsense.pdf</ref> [[C++]],<ref>Full OO DCI Documentation C++ Examples, http://fulloo.info/Examples/C++Examples/index.html</ref> [[C Sharp (programming language)|C#]],<ref>C# source code on
==History==
|