Aspect (computer programming): Difference between revisions

Content deleted Content added
No edit summary
top: Clean up/copyedit
 
(10 intermediate revisions by 8 users not shown)
Line 1:
{{Short description|Feature linked to many parts of a program, unrelated to program's primary function}}
'''aspect''' of a program is a feature linked to many other parts of the program, but which is not related to the program's primary function. An aspect [[Cross-cutting concern|crosscuts]] the program's [[core concern]]s, therefore violating its [[separation of concerns]] that tries to encapsulate unrelated functions. For example, [[Data logging|logging]] code can crosscut many modules, yet the aspect of logging should be separate from the functional concerns of the module it cross-cuts. Isolating such aspects as logging and [[persistence (computer science)|persistence]] from [[business logic]] is the aim of [[aspect-oriented software development]] (AOSD), of which the [[aspect-oriented programming]] (AOP) [[programming paradigm|paradigm]] is the most widely employed.<ref>{{citebook|title=Aspect-Oriented Database Systems|author=Awais Rashid|year= 2004|publisher=Springer|isbn=3-540-00948-5}}</ref>
{{Refimprove|date=June 2008}}
{{single source|date=June 2008}}
In [[computer programming]], an '''aspect''' of a program is a [[Software feature|feature]] linked to many other parts of the program, but which is not related to the program's primary function. An aspect [[Cross-cutting concern|crosscuts]] the program's [[core concern]]sconcerns, therefore violating its [[separation of concerns]] that tries to encapsulate unrelated functions. For example, [[Data logging|logging]] code can crosscut many modules, yet the aspect of logging should be separate from the functional concerns of the module it cross-cuts. Isolating such aspects as logging and [[persistence (computer science)|persistence]] from [[business logic]] is at the aimcore of [[aspect-oriented software development]] (AOSD), of which the [[aspect-oriented programming]] (AOP) [[programming paradigm|paradigm]] is the most widely employed.<ref>{{citebookcite book|title=Aspect-Oriented Database Systems|url=https://archive.org/details/springer_10.1007-978-3-662-05851-0|author=Awais Rashid|year= 2004|publisher=Springer|isbn=3-540-00948-5}}</ref>
 
Aspect-orientation is not limited to programming since it is useful to identify, analyse, trace and modularise concerns (e.g., [[PREview]]{{Clarify|date=June 2011}}) through requirements elicitation, specification, and design. Aspects can be multi-dimensional by allowing both functional and non-functional behaviour to crosscut any other concerns, instead of just mapping non-functional concerns to functional requirements.{{Citation needed|date=April 2010}}.
 
One view of aspect-oriented software development is that every major feature of the program, core concern (business logic), or cross-cutting concern (additional features), is an aspect, and by [[aspect weaver|weaving]] them together (a process also called composition), one finally produces a whole out of the separate aspects. This approach is known as pure aspect programming, but hybrid approaches are more commonly used, perhaps since there is less of a paradigm shift{{Clarify|date=July 2011}} between object- and aspect-oriented programming. There is a similar situation with early aspect software development (e.g., requirements), with traditional methods being enhanced for aspect-orientation and new models proposed. Non-functional concerns (e.g., security) can crosscut functional concerns (e.g., door must be present)common. It is possible for functional concerns to crosscut non-functional or functional concerns (e.g., the need for more features harms mobility). A uniform approach to representation and composition, similar to the pure approach in AOP, is termed multidimensional representation.{{Citation needed|date=April 2010}}
 
The prism analogy describes aspects with terms from the ___domain of light. Like splitting light into its many aspects (different colours) with a prism, one splits a problem into its separate aspects. With another prism you can put the different colours back into a white ray of light, and by the process of weaving aspects one can put the solutions for the different aspects of a problem back into a solution for the whole problem.
 
== See also ==
*[[AspectJ]]
 
== References ==
{{reflist}}
{{Refimprove|date=June 2008}}
<references/>
 
{{aosd}}