Content deleted Content added
m typo: cann (via WP:JWB) |
Citation bot (talk | contribs) Add: title. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | Linked from User:BrownHairedGirl/Articles_with_bare_links | #UCB_webform_linked 245/2185 |
||
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]] 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 GitHub, https://github.com/programmersommer/DCISample</ref> [[Ruby (programming language)|Ruby]],<ref>Ruby source code on Object-Composition Google group,https://groups.google.com/group/object-composition/browse_thread/thread/561f638b43f1b960# 17.10.2009</ref> [[JavaScript]],<ref>JavaScript source code on Object-Composition Google group,https://groups.google.com/group/object-composition/browse_thread/thread/8ec4cf18e127cc3e# 17.10.2009</ref> [[Python (programming language)|Python]],<ref>{{Cite web|url=https://pypi.python.org/pypi/roles|title = Roles: Role based software development}}</ref> Qi4J ([[Java (programming language)|Java]]),<ref>Qi4j source code on Object-Composition Google group,https://groups.google.com/group/object-composition/browse_thread/thread/fe317e615b9008fe# 17.10.2009</ref> [[Scala (programming language)|Scala]], [[Perl]],<ref>Release on CPAN: https://metacpan.org/release/DCI {{Webarchive|url=https://web.archive.org/web/20120124054743/https://metacpan.org/release/DCI |date=2012-01-24 }}</ref> and [[PHP]].<ref>PHP source code on Google, https://code.google.com/p/php-coredci</ref> and [http://fulloo.info/Examples/ several] have been added to the fulloo.info site maintained by the creators of DCI.
==History==
|