Aspect-oriented programming: Difference between revisions

Content deleted Content added
Dzikiłoś (talk | contribs)
Notes and references: Updating the link to active
Tags: Reverted Visual edit
m Undid revision 1305034158 by Bender the Bot (talk) bot error fixed
 
(5 intermediate revisions by 5 users not shown)
Line 170:
Any solution that combines programs at runtime must 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 |access-date=2005-06-19 |url-status=dead |archive-url=https://wdwweb.comarchive.plorg/wweb/20051008065854/http://www.forum2.org/tal/AspectJ2EE.pdf |accessarchive-date=2005-0610-1908}}</ref> This basically implies post-processing, but rather than patching the generated code, this weaving approach ''subclasses'' existing classes so that the modifications are introduced by method-overriding. The existing classes remain untouched, even at runtime, and all existing tools, such as debuggers and profilers, can be used during development. A similar approach has already proven itself in the implementation of many [[Java EE]] application servers, such as [[IBM]]'s [[WebSphere]].
 
===Terminology===
Line 228:
Many [[programming language]]s have implemented AOP, within the language, or as an external [[Library (computing)|library]], including:
*[[.NET]] framework languages ([[C Sharp (programming language)|C#]], [[Visual Basic (.NET)]] (VB.NET))<ref>Numerous:
[https://github.com/vc3/Afterthought Afterthought] {{webarchive|url=https://web.archive.org/web/20160315162029/https://github.com/vc3/Afterthought |date=2016-03-15}}, [http://www.rapier-loom.net/ LOOM.NET] {{webarchive|url=https://web.archive.org/web/20080827215106/http://www.rapier-loom.net/ |date=2008-08-27}}, [http://www.codeplex.com/entlib Enterprise Library 3.0 Policy Injection Application Block] {{webarchive|url=https://web.archive.org/web/20070119154829/http://www.codeplex.com/entlib |date=2007-01-19}}, [httphttps://sourceforge.net/projects/aspectdng/ AspectDNG] {{webarchive|url=https://web.archive.org/web/20040929053513/http://sourceforge.net/projects/aspectdng |date=2004-09-29}}, [http://www.castleproject.org/projects/dynamicproxy/ DynamicProxy] {{webarchive|url=https://web.archive.org/web/20151205001755/http://www.castleproject.org/projects/dynamicproxy/ |date=2015-12-05}}, [httphttps://composestar.sourceforge.net/ Compose*] {{webarchive|url=http://archive.wikiwix.com/cache/20050821193804/http://composestar.sourceforge.net/ |date=2005-08-21}}, [http://www.postsharp.net/ PostSharp] {{webarchive|url=https://web.archive.org/web/20160503095409/https://www.postsharp.net/ |date=2016-05-03}}, [http://www.seasar.org/en/dotnet/ Seasar.NET] {{webarchive|url=https://web.archive.org/web/20060725015434/http://www.seasar.org/en/dotnet/ |date=2006-07-25}}, [http://dotspect.tigris.org/ DotSpect (.SPECT)] {{webarchive|url=https://web.archive.org/web/20060331071126/http://dotspect.tigris.org/ |date=2006-03-31}}, [http://www.springframework.net/ Spring.NET] {{webarchive|url=https://web.archive.org/web/20060402205922/http://springframework.net/ |date=2006-04-02}} (as part of its functionality), [https://www.cs.columbia.edu/~eaddy/wicca Wicca and Phx.Morph] {{webarchive|url=https://web.archive.org/web/20061207110849/http://www1.cs.columbia.edu/~eaddy/wicca/ |date=2006-12-07}}, [http://setpoint.codehaus.org/ SetPoint] {{webarchive|url=https://web.archive.org/web/20081007002006/http://setpoint.codehaus.org/ |date=2008-10-07}}</ref>
**[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.
Line 246:
*[[Groovy (programming language)|Groovy]]
*[[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 |page=25}} {{cite book |chapter-url=http://dl.acm.org/citation.cfm?id=2451457 |first1=Nicolas |last1=Tabareau |first2=Ismael |last2=Figueroa |first3=Éric |last3=Tanter |title=Proceedings of the 12th annual international conference on Aspect-oriented software development |chapter=A typed monadic embedding of aspects |series=Aosd '13 |date=March 2013 |pages=171–184 |doi=10.1145/2451436.2451457 |isbn=9781450317665 |s2cid=27256161 |url=https://hal.inria.fr/hal-00763695/file/main.pdf}} [[Type class]]es allow additional capabilities to be added to a type: {{cite book |first1=Martin |last1=Sulzmann |first2=Meng |last2=Wang |title=Proceedings of the 6th workshop on Foundations of aspect-oriented languages |chapter=Aspect-oriented programming with type classes |chapter-url=http://portal.acm.org/citation.cfm?id=1233842 |date=March 2007 |pages=65–74 |doi=10.1145/1233833.1233842 |isbn=978-1595936615 |s2cid=3253858 |url=https://kar.kent.ac.uk/47468/1/local_143541.pdf}}.</ref>
*[[Java (programming language)|Java]]<ref>Numerous others: [http://www.caesarj.org/ CaesarJ] {{webarchive|url=https://web.archive.org/web/20081219181529/http://caesarj.org/ |date=2008-12-19}}, [httphttps://composestar.sourceforge.net/ Compose*] {{webarchive|url=http://archive.wikiwix.com/cache/20050821193804/http://composestar.sourceforge.net/ |date=2005-08-21}}, [http://dynaop.dev.java.net/ Dynaop] {{webarchive|url=https://web.archive.org/web/20070724061030/https://dynaop.dev.java.net/ |date=2007-07-24}}, [http://jac.objectweb.org/ JAC] {{webarchive|url=https://web.archive.org/web/20040619135517/http://jac.objectweb.org/ |date=2004-06-19}}, [[Google Guice]] (as part of its functionality), [http://www.csg.is.titech.ac.jp/~chiba/javassist/ Javassist] {{webarchive|url=https://web.archive.org/web/20040901095342/http://www.csg.is.titech.ac.jp/~chiba/javassist/ |date=2004-09-01}}, [http://ssel.vub.ac.be/jasco/ JAsCo (and AWED)] {{webarchive|url=https://web.archive.org/web/20050411010213/http://ssel.vub.ac.be/jasco/ |date=2005-04-11}}, [http://www.ics.uci.edu/~trungcn/jaml/ JAML] {{webarchive|url=https://web.archive.org/web/20050415091244/http://www.ics.uci.edu/~trungcn/jaml/ |date=2005-04-15}}, [http://labs.jboss.com/portal/jbossaop JBoss AOP] {{webarchive|url=https://web.archive.org/web/20061017211354/http://labs.jboss.com/portal/jbossaop/ |date=2006-10-17}}, [http://roots.iai.uni-bonn.de/research/logicaj LogicAJ] {{webarchive|url=https://web.archive.org/web/20060504154852/http://roots.iai.uni-bonn.de/research/logicaj/ |date=2006-05-04}}, [http://www.objectteams.org/ Object Teams] {{webarchive|url=https://web.archive.org/web/20050831200910/http://objectteams.org/ |date=2005-08-31}}, [http://prose.ethz.ch/ PROSE] {{webarchive|url=https://web.archive.org/web/20070124094344/http://prose.ethz.ch/ |date=2007-01-24}}, [http://www.aspectbench.org/ The AspectBench Compiler for AspectJ (abc)] {{webarchive|url=https://web.archive.org/web/20141216200424/http://aspectbench.org/ |date=2014-12-16}}, [[Spring framework]] (as part of its functionality), [[Seasar]], [http://roots.iai.uni-bonn.de/research/jmangler/ The JMangler Project] {{webarchive|url=https://web.archive.org/web/20051028191025/http://roots.iai.uni-bonn.de/research/jmangler/ |date=2005-10-28}}, [httphttps://injectj.sourceforge.net/ InjectJ] {{webarchive|url=https://web.archive.org/web/20050405080539/http://injectj.sourceforge.net/ |date=2005-04-05}}, [http://www.csg.is.titech.ac.jp/projects/gluonj/ GluonJ] {{webarchive|url=https://web.archive.org/web/20070206010219/http://www.csg.is.titech.ac.jp/projects/gluonj/ |date=2007-02-06}}, [http://www.st.informatik.tu-darmstadt.de/static/pages/projects/AORTA/Steamloom.jsp Steamloom] {{webarchive|url=https://web.archive.org/web/20070818100432/http://www.st.informatik.tu-darmstadt.de/static/pages/projects/AORTA/Steamloom.jsp |date=2007-08-18}}</ref>
**[[AspectJ]]
*[[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}}, [httphttps://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|access-date=11 August 2015|url-status=live|archive-url=https://web.archive.org/web/20150717094121/http://luaforge.net/projects/aspectlua/|archive-date=17 July 2015}}</ref>
Line 258:
*[[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/ Seasar.PHP] {{webarchive|url=https://web.archive.org/web/20051226040309/http://www.seasar.org/en/php5/ |date=2005-12-26}}, [https://archive.today/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 |date=14 December 2005 |title=Aspect-Oriented Programming in Prolog |url=http://www.bigzaphod.org/whirl/dma/docs/aspects/aspects-man.html |url-status=dead |archive-url=https://web.archive.org/web/20120303120515/https://www.bigzaphod.org/whirl/dma/docs/aspects/aspects-man.html |archive-date=3 March 2012 |access-date=5 May 2018 |website=bigzaphod.org}}</ref>
*[[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}}, [httphttps://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}}, [httphttps://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|access-date=11 August 2015|url-status=live|archive-url=https://web.archive.org/web/20150905062740/http://planet.racket-lang.org/display.ss?package=aspectscheme.plt&owner=dutchyn|archive-date=5 September 2015}}</ref>
*[[Ruby (programming language)|Ruby]]<ref>{{cite web|url=httphttps://aspectr-fork.sourceforge.net/|title=AspectR – Simple aspect-oriented programming in Ruby|access-date=11 August 2015|url-status=live|archive-url=http://archive.wikiwix.com/cache/20150812003432/http://aspectr-fork.sourceforge.net/|archive-date=12 August 2015}}</ref><ref>{{cite web|url=http://aquarium.rubyforge.org/|archive-url=https://web.archive.org/web/20071026055811/http://aquarium.rubyforge.org/|url-status=dead|archive-date=26 October 2007|title=Home|author=Dean Wampler|access-date=11 August 2015}}</ref><ref>{{cite web|url=https://github.com/gcao/aspector|title=gcao/aspector|work=GitHub|access-date=11 August 2015|url-status=live|archive-url=https://web.archive.org/web/20150104180534/https://github.com/gcao/aspector|archive-date=4 January 2015}}</ref>
*[[Squeak]] [[Smalltalk]]<ref>{{cite web|url=http://www.prakinf.tu-ilmenau.de/~hirsch/Projects/Squeak/AspectS/|title=AspectS|website=tu-ilmenau.de|access-date=5 May 2018|url-status=dead|archive-url=https://web.archive.org/web/20060106112030/http://www.prakinf.tu-ilmenau.de/~hirsch/Projects/Squeak/AspectS/|archive-date=6 January 2006}}</ref><ref>{{cite web|url=http://csl.ensm-douai.fr/MetaclassTalk|title=MetaclassTalk: Reflection and Meta-Programming in Smalltalk|access-date=11 August 2015|url-status=dead|archive-url=https://web.archive.org/web/20150729062351/http://csl.ensm-douai.fr/MetaclassTalk|archive-date=29 July 2015}}</ref>
*[[UML 2|UML 2.0]]<ref>{{cite web|url=http://www.iit.edu/~concur/weavr|title=WEAVR|website=iit.edu|access-date=5 May 2018|url-status=live|archive-url=https://web.archive.org/web/20081212200221/http://www.iit.edu/~concur/weavr/|archive-date=12 December 2008}}</ref>
Line 287:
* [http://www.cmsdevelopment.com/en/articles/aosdinphp/ Aspect-oriented Software Development and PHP, Dmitry Sheiko, 2006]
* {{cite book |author1=Siobhán Clarke|author1-link=Siobhán Clarke |author2=Elisa Baniassad |name-list-style=amp |year=2005 |title=Aspect-Oriented Analysis and Design: The Theme Approach |publisher=Addison-Wesley |isbn=978-0-321-24674-5}}
* {{cite book |author=Raghu Yedduladoddi |date=2009 |title=Aspect Oriented Software Development: An Approach to Composing UML Design Models |publisher=VDM |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|doi=10.35537/10915/35861|url=http://sedici.unlp.edu.ar/handle/10915/35861|access-date=30 May 2014|doi-access=free}}