Content deleted Content added
m Task 18 (cosmetic): eval 49 templates: hyphenate params (35×); |
|||
Line 22:
The examples in this article use AspectJ.
The [[Microsoft Transaction Server]] is considered to be the first major application of AOP followed by [[Enterprise JavaBeans]].<ref name="BoxSells2002">{{cite book|author1=Don Box|author2=Chris Sells|title=Essential.NET: The common language runtime|url=https://archive.org/details/essentialnetcomm01boxd|url-access=registration|
== Motivation and basic concepts ==
Line 88:
</syntaxhighlight>
One can think of AOP as a debugging tool or as a user-level tool. Advice should be reserved for the cases where you cannot get the function changed (user level)<ref>{{cite web|url=https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html|title=gnu.org|website=www.gnu.org|
==Join point models==
Line 172:
Any solution that combines programs at runtime has to provide views that segregate them properly to maintain the programmer's segregated model. Java's bytecode support for multiple source files enables any debugger to step through a properly woven .class file in a source editor. However, some third-party decompilers cannot process woven code because they expect code produced by Javac rather than all supported bytecode forms (see also [[#Criticism|§ Criticism]], below).
[[Deploy-time]] weaving offers another approach.<ref>{{cite web |url=http://www.forum2.org/tal/AspectJ2EE.pdf |title=Archived copy |
===Terminology===
Line 198:
==Criticism==
The most basic criticism of the effect of AOP is that control flow is obscured, and that it is not only worse than the much-maligned [[GOTO]], but is in fact closely analogous to the joke [[COME FROM]] statement.<ref name="harmful" /> The ''obliviousness of application'', which is fundamental to many definitions of AOP (the code in question has no indication that an advice will be applied, which is specified instead in the pointcut), means that the advice is not visible, in contrast to an explicit method call.<ref name="harmful">{{cite conference|url=http://pp.info.uni-karlsruhe.de/uploads/publikationen/constantinides04eiwas.pdf| title=AOP Considered Harmful |first1=Constantinos |last1=Constantinides |first2=Therapon |last2=Skotiniotis |first3=Maximilian |last3=Störzer|date=September 2004|
<syntaxhighlight lang="basic" highlight="4">
5 INPUT X
Line 221:
Indeed, the pointcut may depend on runtime condition and thus not be statically deterministic. This can be mitigated but not solved by static analysis and IDE support showing which advices ''potentially'' match.
General criticisms are that AOP purports to improve "both modularity and the structure of code", but some counter that it instead undermines these goals and impedes "independent development and understandability of programs".<ref name="steimann">{{Cite journal | doi = 10.1145/1167515.1167514| title = The paradoxical success of aspect-oriented programming| journal = ACM SIGPLAN Notices| volume = 41| issue = 10| pages = 481–497| year = 2006| last1 = Steimann | first1 = F. | citeseerx = 10.1.1.457.2210}}, ([http://people.dsv.su.se/~johano/ioor/succ_aop.pdf slides] {{webarchive|url=https://web.archive.org/web/20160304060007/http://people.dsv.su.se/~johano/ioor/succ_aop.pdf |date=2016-03-04 }},[http://www.eecs.ucf.edu/~leavens/modular-aop/Discussion.pdf slides 2] {{webarchive|url=https://web.archive.org/web/20150923234021/http://www.eecs.ucf.edu/~leavens/modular-aop/Discussion.pdf |date=2015-09-23 }}, [http://www.oopsla.org/2006/submission/essays/the_paradoxical_success_of_aspect-oriented_programming.html abstract] {{webarchive|url=https://web.archive.org/web/20150924060711/http://www.oopsla.org/2006/submission/essays/the_paradoxical_success_of_aspect-oriented_programming.html |date=2015-09-24 }}), Friedrich Steimann, Gary T. Leavens, [[OOPSLA]] 2006</ref> Specifically, quantification by pointcuts breaks modularity: "one must, in general, have whole-program knowledge to reason about the dynamic execution of an aspect-oriented program."<ref>{{cite web|url=http://www.eecs.ucf.edu/~leavens/modular-aop/|title=More Modular Reasoning for Aspect-Oriented Programs|
Technical criticisms include that the quantification of pointcuts (defining where advices are executed) is "extremely sensitive to changes in the program", which is known as the ''fragile pointcut problem''.<ref name="steimann"/> The problems with pointcuts are deemed intractable: if one replaces the quantification of pointcuts with explicit annotations, one obtains [[attribute-oriented programming]] instead, which is simply an explicit subroutine call and suffers the identical problem of scattering that AOP was designed to solve.<ref name="steimann"/>
Line 231:
**[https://www.postsharp.net/ PostSharp] is a commercial AOP implementation with a free but limited edition.
**[[Unity Application Block|Unity]] provides an API to facilitate proven practices in core areas of programming including data access, security, logging, exception handling and others.
*[[ActionScript]]<ref>{{cite web|url=http://www.as3commons.org/as3-commons-bytecode|title=Welcome to as3-commons-bytecode|website=as3commons.org|
*[[Ada (programming language)|Ada]]<ref>{{cite web|url=http://www.adacore.com/uploads/technical-papers/Ada2012_Rational_Introducion.pdf|title=Ada2012 Rationale|website=adacore.com|
*[[AutoHotkey]]<ref>{{cite web|url=http://www.autohotkey.com/forum/viewtopic.php?p=243426|archive-url=https://archive.is/20130117125117/http://www.autohotkey.com/forum/viewtopic.php?p=243426|url-status=dead|archive-date=17 January 2013|title=Function Hooks|website=autohotkey.com|
*[[C (programming language)|C]] / [[C++]]<ref>Several: [[AspectC++]], [http://wwwiti.cs.uni-magdeburg.de/iti_db/forschung/fop/featurec/ FeatureC++], [http://www.cs.ubc.ca/labs/spl/projects/aspectc.html AspectC] {{webarchive|url=https://web.archive.org/web/20060821190630/http://www.cs.ubc.ca/labs/spl/projects/aspectc.html |date=2006-08-21 }}, [http://www.aspectc.net/ AspeCt-oriented C] {{webarchive|url=https://web.archive.org/web/20081120144608/http://www.aspectc.net/ |date=2008-11-20 }}, [https://archive.is/20120721212648/http://www.bramadams.org/aspicere/index.html Aspicere]</ref>
*[[COBOL]]<ref>{{cite web|url=http://homepages.vub.ac.be/~kdeschut/cobble/|title=Cobble|website=vub.ac.be|
*The [[Cocoa (API)|Cocoa]] [[Objective-C]] frameworks<ref>{{cite web|url=http://www.ood.neu.edu/aspectcocoa/|title=AspectCocoa|website=neu.edu|
*[[ColdFusion]]<ref>{{cite web|url=http://coldspringframework.org/|title=ColdSpring Framework: Welcome|date=5 November 2005|
*[[Common Lisp]]<ref>{{cite web|url=http://common-lisp.net/project/closer/aspectl.html|title=Closer Project: AspectL.|
*[[Borland Delphi|Delphi]]<ref>{{cite web|url=https://code.google.com/p/infra/|title=infra - Frameworks Integrados para Delphi - Google Project Hosting|
*[[Delphi Prism]]<ref>{{cite web|url=http://prismwiki.codegear.com/en/Cirrus|title=RemObjects Cirrus|website=codegear.com|
*[[E (verification language)|e]] (IEEE 1647)
*[[Emacs Lisp]]<ref>{{cite web|url=https://www.gnu.org/software/emacs/elisp/html_node/Advising-Functions.html|title=Emacs Advice Functions|website=gnu.org|
*[[Groovy (programming language)|Groovy]]
*[[Haskell (programming language)|Haskell]]<ref>[[Monad (functional programming)|Monad]]s allow program semantics to be altered by changing the type of the program without altering its code: {{cite journal | citeseerx = 10.1.1.25.8262 | title = Monads As a theoretical basis for AOP |journal = International Workshop on Aspect-Oriented Programming at ECOOP | first = Wolfgang | last = De Meuter | year = 1997}} {{cite journal | url = http://dl.acm.org/citation.cfm?id=2451457 | title = A Typed Monadic Embedding of Aspects | first1 = Nicolas | last1 = Tabareau | first2 = Ismael | last2 = Figueroa | first3 = Éric | last3 = Tanter | journal = Proceedings of the 12th Annual International Conference on Aspect-oriented Software Development | date = March 2013 | pages = 171–184 | doi = 10.1145/2451436.2451457 | isbn = 9781450317665 | s2cid = 27256161 }} [[Type class]]es allow additional capabilities to be added to a type: {{cite journal | first1 = Martin | last1 = Sulzmann | first2 = Meng | last2 = Wang | url = http://portal.acm.org/citation.cfm?id=1233842 | title = Aspect-oriented programming with type classes | journal = Proceedings of the 6th Workshop on Foundations of Aspect-oriented Languages | date = March 2007 | pages = 65–74 | doi = 10.1145/1233833.1233842 | isbn = 978-1595936615 | s2cid = 3253858 }}.</ref>
Line 249:
*[[JavaScript]]<ref>Many: [http://i.gotfresh.info/2007/12/7/advised-methods-for-javascript-with-prototype/ Advisable] {{webarchive|url=https://web.archive.org/web/20080704052200/http://i.gotfresh.info/2007/12/7/advised-methods-for-javascript-with-prototype |date=2008-07-04 }}, [https://code.google.com/p/ajaxpect/ Ajaxpect] {{webarchive|url=https://web.archive.org/web/20160709203939/https://code.google.com/p/ajaxpect/ |date=2016-07-09 }}, [http://plugins.jquery.com/project/AOP jQuery AOP Plugin] {{webarchive|url=https://web.archive.org/web/20080113184156/http://plugins.jquery.com/project/AOP |date=2008-01-13 }}, [http://aspectes.tigris.org/ Aspectes] {{webarchive|url=http://archive.wikiwix.com/cache/20060508035836/http://aspectes.tigris.org/ |date=2006-05-08 }}, [http://www.aspectjs.com/ AspectJS] {{webarchive|url=https://web.archive.org/web/20081216010832/http://www.aspectjs.com/ |date=2008-12-16 }}, [http://www.cerny-online.com/cerny.js/ Cerny.js] {{webarchive|url=https://web.archive.org/web/20070627024906/http://www.cerny-online.com/cerny.js/ |date=2007-06-27 }}, [http://dojotoolkit.org/ Dojo Toolkit] {{webarchive|url=https://web.archive.org/web/20060221211958/http://www.dojotoolkit.org/ |date=2006-02-21 }}, [http://humax.sourceforge.net/ Humax Web Framework] {{webarchive|url=https://web.archive.org/web/20081209103012/http://humax.sourceforge.net/ |date=2008-12-09 }}, [https://code.google.com/p/joose-js/ Joose] {{webarchive|url=https://web.archive.org/web/20150318193601/http://code.google.com/p/joose-js/ |date=2015-03-18 }}, [[Prototype.js|Prototype]] - [http://www.prototypejs.org/api/function/wrap Prototype Function#wrap] {{webarchive|url=https://web.archive.org/web/20090505233620/http://www.prototypejs.org/api/function/wrap |date=2009-05-05 }}, [http://developer.yahoo.com/yui/3/api/Do.html YUI 3 (Y.Do)] {{webarchive|url=https://web.archive.org/web/20110125115930/https://developer.yahoo.com/yui/3/api/Do.html |date=2011-01-25 }}</ref>
*[[Logtalk (programming language)|Logtalk]]<ref>Using built-in support for categories (which allows the encapsulation of aspect code) and event-driven programming (which allows the definition of ''before'' and after ''event'' handlers).</ref>
*[[Lua (programming language)|Lua]]<ref>{{cite web|url=http://luaforge.net/projects/aspectlua/|title=AspectLua|
*[[make (software)|make]]<ref>{{cite web|url=http://www.bramadams.org/makao/|archive-url=https://archive.is/20120724151524/http://www.bramadams.org/makao/|url-status=dead|archive-date=24 July 2012|title=MAKAO, re(verse)-engineering build systems|
*[[Matlab]]<ref>{{cite web|url=http://www.sable.mcgill.ca/mclab/aspectmatlab/index.html|title=McLab|
*[[ML (programming language)|ML]]<ref>{{cite web|url=http://www.cs.princeton.edu/sip/projects/aspectml/|title=AspectML - Aspect-oriented Functional Programming Language Research|
*[[Perl]]<ref>{{cite web|url=https://metacpan.org/module/Aspect|title=Aspect - Aspect-Oriented Programming (AOP) for Perl - metacpan.org|author=Adam Kennedy|
*[[PHP]]<ref>Several: [http://aop.io PHP-AOP (AOP.io)] {{webarchive|url=http://archive.wikiwix.com/cache/20140818050736/http://aop.io/ |date=2014-08-18 }}, [http://go.aopphp.com Go! AOP framework] {{webarchive|url=https://web.archive.org/web/20130301043014/http://go.aopphp.com/ |date=2013-03-01 }}, [https://code.google.com/p/phpaspect/ PHPaspect] {{webarchive|url=https://web.archive.org/web/20160822234503/https://code.google.com/p/phpaspect/ |date=2016-08-22 }}, [http://www.seasar.org/en/php5/index.html Seasar.PHP] {{webarchive|url=https://web.archive.org/web/20051226040309/http://www.seasar.org/en/php5/index.html |date=2005-12-26 }}, [https://archive.is/20120712081326/http://php-aop.googlecode.com/ PHP-AOP], [https://flow.neos.io/ Flow] {{webarchive|url=https://web.archive.org/web/20180104132543/https://flow.neos.io/ |date=2018-01-04 }}, [https://github.com/AOP-PHP/AOP AOP PECL Extension] {{webarchive|url=https://web.archive.org/web/20170411031809/https://github.com/AOP-PHP/AOP |date=2017-04-11 }}</ref>
*[[Prolog]]<ref>{{cite web|url=http://www.bigzaphod.org/whirl/dma/docs/aspects/aspects-man.html|title=bigzaphod.org is coming soon|website=www.bigzaphod.org|
*[[Python (programming language)|Python]]<ref>Several: [http://peak.telecommunity.com/ PEAK] {{webarchive|url=https://web.archive.org/web/20050409082546/http://peak.telecommunity.com/ |date=2005-04-09 }}, [https://web.archive.org/web/20110609153559/http://old.aspyct.org/ Aspyct AOP], [http://www.cs.tut.fi/~ask/aspects/aspects.html Lightweight Python AOP] {{webarchive|url=https://web.archive.org/web/20041009194711/http://www.cs.tut.fi/~ask/aspects/aspects.html |date=2004-10-09 }}, [http://www.logilab.org/projects/aspects Logilab's aspect module] {{webarchive|url=https://web.archive.org/web/20050309034259/http://www.logilab.org/projects/aspects |date=2005-03-09 }}, [http://pythius.sourceforge.net/ Pythius] {{webarchive|url=https://web.archive.org/web/20050408072457/http://pythius.sourceforge.net/ |date=2005-04-08 }}, [http://springpython.webfactional.com/1.1.x/reference/html/aop.html Spring Python's AOP module] {{webarchive|url=https://web.archive.org/web/20160304055741/http://springpython.webfactional.com/1.1.x/reference/html/aop.html |date=2016-03-04 }}, [http://pytilities.sourceforge.net/doc/1.1.0/guide/aop/ Pytilities' AOP module] {{webarchive|url=https://web.archive.org/web/20110825101213/http://pytilities.sourceforge.net/doc/1.1.0/guide/aop/ |date=2011-08-25 }}, [http://python-aspectlib.readthedocs.org/en/latest/ aspectlib] {{webarchive|url=https://web.archive.org/web/20141105061010/http://python-aspectlib.readthedocs.org/en/latest/ |date=2014-11-05 }}</ref>
*[[Racket (programming language)|Racket]]<ref>{{cite web|url=http://planet.racket-lang.org/display.ss?package=aspectscheme.plt&owner=dutchyn|title=PLaneT Package Repository : PLaneT > dutchyn > aspectscheme.plt|
*[[Ruby (programming language)|Ruby]]<ref>{{cite web|url=http://aspectr-fork.sourceforge.net/|title=AspectR - Simple aspect-oriented programming in Ruby|
*[[Squeak]] [[Smalltalk]]<ref>{{cite web|url=http://www.prakinf.tu-ilmenau.de/~hirsch/Projects/Squeak/AspectS/|title=AspectS|website=tu-ilmenau.de|
*[[UML 2|UML 2.0]]<ref>{{cite web|url=http://www.iit.edu/~concur/weavr|title=WEAVR|website=iit.edu|
*[[XML]]<ref>{{cite web|url=https://code.google.com/p/aspectxml/|title=aspectxml - An Aspect-Oriented XML Weaving Engine (AXLE) - Google Project Hosting|
==See also==
Line 289:
* {{cite book |author = Raghu Yedduladoddi |date = 2009 | title = Aspect Oriented Software Development: An Approach to Composing UML Design Models | isbn = 978-3-639-12084-4}}
* "Adaptive Object-Oriented Programming Using Graph-Based Customization" – Lieberherr, Silva-Lepe, ''et al.'' - 1994
* {{cite journal|last=Zambrano Polo y La Borda|first=Arturo Federico|title=Addressing aspect interactions in an industrial setting: experiences, problems and solutions|date=5 June 2013|pages=159|url=http://sedici.unlp.edu.ar/handle/10915/35861|
* Wijesuriya, Viraj Brian (2016-08-30) ''[http://www.slideshare.net/tyrantbrian/aspect-oriented-development Aspect Oriented Development, Lecture Notes, University of Colombo School of Computing, Sri Lanka '']
* {{ cite book | first = Matthew D. | last = Groves | author-link = Matthew D. Groves | year = 2013 | title = AOP in .NET | isbn = 9781617291142 }}
Line 299:
* [https://web.archive.org/web/20141216200424/http://aspectbench.org/ The AspectBench Compiler for AspectJ], another Java implementation
* [http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=AOP@work: Series of IBM developerWorks articles on AOP]
* {{cite web |last1=Laddad |first1=Ramnivas |date=2002-01-18 |df=mdy |url=https://www.infoworld.com/article/2073918/i-want-my-aop---part-1.html |title=I want my AOP!, Part 1 |work=[[JavaWorld]] |
* [https://web.archive.org/web/20090821185951/http://codefez.com/what-is-aspect-oriented-programming/ What is Aspect-Oriented Programming?], introduction with RemObjects Taco
* [http://www.cis.uab.edu/gray/Research/C-SAW/ Constraint-Specification Aspect Weaver]
|