Data, context and interaction: Difference between revisions

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 Object-Composition Google group,http https://object-composition.googlegroupsgithub.com/webprogrammersommer/20090504_C%23_DCI.zip?gda=KuAYkEcAAADrRvU1tICZInrYQGkdqcjVB9LJpDFQtNZStXvSrZaE07Ryyh4ndddBwXohD2r2F8gbzHe87USdioT9uNiA7PHaeV4duv6pDMGhhhZdjQlNAw{{Dead link|date=July 2019 |bot=InternetArchiveBot |fix-attempted=yes }} 17.10.2009ASPNETCoreDCI</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>https://pypi.python.org/pypi/roles</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>, [[C#]].<ref>ASP.NET source code on github, https://github.com/programmersommer/ASPNETCoreDCI</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==