Subject-oriented programming: Difference between revisions

Content deleted Content added
Delete self-link
Bender the Bot (talk | contribs)
 
(30 intermediate revisions by 18 users not shown)
Line 1:
In [[computing]], '''Subjectsubject-Orientedoriented Programmingprogramming''' is an [[Object-oriented programming|object-oriented]] [[programming paradigm|software paradigm]] in which the state (fields) and behavior (methods) of objects are not seen as intrinsic to the objects themselves, but are provided by various subjective perceptions (“subjects”"subjects") of the objects. The term and concepts were first published in September 1993 in a conference paper<ref>William Harrison and Harold Ossher, Subject-Oriented Programming - A Critique of Pure Objects, Proceedings of 1993 Conference on Object-Oriented Programming Systems, Languages, and Applications, September 1993</ref> which was later recognized as being one of the three most influential papers to be presented at the conference between 1986 and 1996.<ref>{{deadCite linkweb|dateurl=May 2013}}httphttps://www.sigplan.org/award-oopslaAwards/OOPSLA/|title=Most Influential OOPSLA Paper Award|website=www.htmsigplan.org}}</ref> As illustrated in that paper, an analogy is made with the contrast between the philosophical views of [[Plato]] and [[Immanuel Kant|Kant]] with respect to the characteristics of “real”"real" objects, but applied to software ones. For example, while we may all perceive a tree as having a measurable height, weight, leaf-mass, etc., from the point of view of a bird, a tree may also have measures of relative value for food or nesting purposes, or from the point of view of a tax-assessor, it may have a certain taxable value in a given year. Neither the bird’sbird's nor the tax-assessor’sassessor's additional state information need be seen as intrinsic to the tree, but are added by the perceptions of the bird and tax-assessor, and from Kant’sKant's analysis, the same may be true even of characteristics we think of as intrinsic.
{{Programming paradigms}}
In [[computing]], '''Subject-Oriented Programming''' is an [[Object-oriented programming|object-oriented]] [[programming paradigm|software paradigm]] in which the state (fields) and behavior (methods) of objects are not seen as intrinsic to the objects themselves, but are provided by various subjective perceptions (“subjects”) of the objects. The term and concepts were first published in September 1993 in a conference paper<ref>William Harrison and Harold Ossher, Subject-Oriented Programming - A Critique of Pure Objects, Proceedings of 1993 Conference on Object-Oriented Programming Systems, Languages, and Applications, September 1993</ref> which was later recognized as being one of the three most influential papers to be presented at the conference between 1986 and 1996.<ref>{{dead link|date=May 2013}}http://www.sigplan.org/award-oopsla.htm</ref> As illustrated in that paper, an analogy is made with the contrast between the philosophical views of [[Plato]] and [[Immanuel Kant|Kant]] with respect to the characteristics of “real” objects, but applied to software ones. For example, while we may all perceive a tree as having a measurable height, weight, leaf-mass, etc., from the point of view of a bird, a tree may also have measures of relative value for food or nesting purposes, or from the point of view of a tax-assessor, it may have a certain taxable value in a given year. Neither the bird’s nor the tax-assessor’s additional state information need be seen as intrinsic to the tree, but are added by the perceptions of the bird and tax-assessor, and from Kant’s analysis, the same may be true even of characteristics we think of as intrinsic.
 
Subject-oriented programming advocates the organization of the [[Class (computer science)|classes]] that describe [[Object (computer science)|objects]] into “subjects”"subjects", which may be composed to form larger subjects. At points of access to fields or [[Method (computer science)|methods]], several subjects’subjects' contributions may be composed. These points were characterized as the [[join-point]]s<ref>Harold Ossher , Peri Tarr. Operation-Level Composition: A Case in (Join) Point, in ECOOP ’98'98 Workshop Reader, 406–409</ref> of the subjects. For example, if a tree is cut- down, the methods involved may need to join behavior in the bird and tax-assessor’sassessor's subjects with that of the tree’stree's own. It is therefore fundamentally a view of the compositional nature of software development, as opposed to the algorithmic (procedural) or representation-hiding (object) nature.
 
==ExamplesRelationships==
===Relationship to aspect-oriented programming===
{{Empty section|date=March 2012}}
 
==Relationship to aspect-oriented programming==
 
The introduction of [[aspect-oriented programming]] in 1997<ref>{{Cite conference | doi = 10.1007/BFb0053381| title = Aspect-oriented programming| work = Proceedings of the 11th European Conference on Object-Oriented Programming| conference = [[European Conference on Object-Oriented Programming|ECOOP]]'97| volume = 1241| pages = 220–242| series = [[Lecture Notes in Computer Science|LNCS]]| year = 1997| last1 = Kiczales | first1 = G. | author1-link = Gregor Kiczales | last2 = Lamping | first2 = J. | last3 = Mendhekar | first3 = A. | last4 = Maeda | first4 = C. | last5 = Lopes | first5 = C. | last6 = Loingtier | first6 = J. M. | last7 = Irwin | first7 = J. | isbn = 3-540-63089-9| citeseerx = 10.1.1.115.8660| url = http://www.cs.ubc.ca/~gregor/papers/kiczales-ECOOP1997-AOP.pdf}}</ref> raised questions about its relationship to subject-oriented programming, and about the difference between subjects and aspects. These questions were unanswered for some time, but were addressed in the patent on Aspect-oriented programming filed in 1999<ref>Kiczales; Gregor J.; Lamping; John O.; Lopes; Cristina V.; Hugunin; James J.; Hilsdale; Erik A.; Boyapati; Chandrasekhar, Aspect Oriented Programming, United States Patent 6,467,086, October 15, 2002</ref> in which two points emerge as characteristic differences from earlier art:
Line 13 ⟶ 10:
* the aspect transparently forces the cross-cutting behavior on object classes and other software entities
 
In the subject-oriented view, the cross-cut may be placed separately from the aspect (subject) and the behavior is not forced by the aspect, but governed by rules of composition. Hindsight<ref>William Harrison. De-constructing and Re-constructing Aspect-Orientation, Seventh Annual Workshop on Foundations of Aspect Languages, Brussels, Belgium, 1 April 2008, edited by Gary T. Leavens , ACM Digital Library, 2008, pp. 43-50</ref> makes it also possible to distinguish aspect-oriented programming by its introduction and exploitation of the concept of a query-like [[pointcut]] to externally impose the join-points used by aspects in general ways.
 
In the presentation of subject-oriented programming, the join-points were deliberately restricted to field access and method call on the grounds that those were the points at which well-designed frameworks were designed to admit functional extension. The use of externally imposed pointcuts is an important linguistic capability, but remains one of the most controversial features of aspect-oriented programming.<ref>Friedrich Steimann. The paradoxical success of aspect-oriented programming, Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, Portland, Oregon, USA , 2006, pp. 481 - 497</ref>
 
===Relationship to aspect-oriented software development===
 
By the turn of the millennium, it was clear that a number of research groups were pursuing different technologies that employed the composition or attachment of separately packaged state and function to form objects.<ref>Communications of the ACM, Vol. 44, No. 10, October 1994, pp. 28-95</ref> To distinguish the common field of interest from Aspect-Oriented Programming with its particular patent definitions and to emphasize that the compositional technology deals with more than just the coding phase of software development, these technologies were organized together under the term [[Aspect-Oriented Software Development]],<ref>http{{Cite web|url=https://aosd.net/|title=Home|website=AOSD.net}}</ref> and an organization and series on international conferences begun on the subject. Like aspect-oriented programming, subject-oriented programming, composition filters, [[Feature Oriented Programming|feature -oriented programming]] and adaptive methods are considered to be aspect-oriented software development approaches.
 
==Dimensions==
==={{anchor|Multi-dimensional separation of concerns}}Multi-dimensional separation of concerns, Hyper/J, and the Concern Manipulation Environment===
 
The original formulation of subject-oriented programming deliberately envisioned it as a packaging technology – allowing the space of functions and data types to be extended in either dimension. The first implementations had been for C++,<ref>Harold Ossher, Matthew Kaplan, William Harrison, Alexander Katz and Vincent Kruskal, Subject-Oriented Composition Rules, Proceedings of 1995 Conference on Object-Oriented Programming Systems, Languages, and Applications, October 1995</ref> and Smalltalk.<ref>Hafedh Mili, William Harrison, Harold Ossher, Supporting Subject-Oriented Programming in Smalltalk, Proceedings of TOOLS USA 96, August 1996</ref> These implementations exploited the concepts of software labels and composition rules to describe the joining of subjects.
 
To address the concern that a better foundation should be provided for the analysis and composition of software not just in terms of its packaging but in terms of the various concerns these packages addressed, an explicit organization of the material was developed in terms of a multi-dimensional “matrix”"matrix" in which concerns are related to the software units that implement them. This organization is called '''Multi{{em|multi-Dimensionaldimensional Separationseparation of Concerns'''concerns}}, and the paper describing it<ref>Harold Ossher, Peri Tarr, William Harrison, Stanley Sutton, N Degrees of Separation: Multi-Dimensional Separation of Concerns, Proceedings of 1999 International Conference on Software Engineering, May 1999</ref> has been recognized as the most influential paper of the ICSE 1999 Conference.<ref>{{Cite web|url=http://www.sigsoft.org/awards/mostInfPapAwd.htm|title = SIGSOFT - ACM Special Interest Group on Software Engineering}}</ref>
 
This new concept was implemented for composing [[Java (programming language)|Java]] software, using the name '''Hyper/J''' for the tool.<ref>Harold Ossher, Peri Tarr. Hyper/J: Multi-dimensional separation of concerns for Java, Proceedings of the 23rd International Conference on Software Engineering, Toronto, Ontario, Canada, 2001, Pages: 821 - 822</ref>
Line 37 ⟶ 35:
* and a priority ordering specification to resolve conflicts among conflicting rules.
 
Both Hyper/J and CME are available, from alphaWorks<ref>{{Cite web|url=http://www.alphaworks.ibm.com/tech/hyperj|title = Legacy Communities - IBM Community| date=23 April 2009 }}</ref> or sourceforge,<ref>http{{Cite web|url=https://sourceforge.net/projects/cme/|title=Concern Manipulation Environment (CME)|date=24 April 2015 }}</ref> respectively, but neither is actively supported.
 
===Subject-oriented programming as a "third dimension"===
Method dispatch in object oriented programming can be thought of as "two dimensional" in the sense that the code executed depends on both the method name and the object in question. This can be contrasted<ref>[{{Cite web|url=http://www.jot.fm/issues/issue_2008_03/article4/ |title=Journal of Object Technology: Context Oriented Programming]}}</ref> with procedural programming, where a procedure name resolves directly, or one dimensionally, onto a subroutine, and also to subject oriented programming, where the sender or subject is also relevant to dispatch, constituting a third dimension.
 
==See also==
* [[Separation of concerns]]
* [[Data, context and interaction]]
 
==References==
Line 54 ⟶ 52:
* [http://www.eclipse.org/technology/archived.php Eclipse Archived Technology Projects]
* [http://amethyst.io Amethyst: a JavaScript library for Subject-Oriented Programming]
 
{{Programming paradigms navbox}}
 
[[Category:Object-oriented programming]]