TheImpactofAspect-Oriented ProgrammingonFuture ApplicationDesign - - PowerPoint PPT Presentation

the impact of aspect oriented programming on future
SMART_READER_LITE
LIVE PREVIEW

TheImpactofAspect-Oriented ProgrammingonFuture ApplicationDesign - - PowerPoint PPT Presentation

ISSemminaryWS00/01 TheImpactofAspect-Oriented ProgrammingonFuture ApplicationDesign AndreiPopovici InformationandCommunicationResearchGroup ISSeminarJan.17th,2001 1 ISSemminaryWS00/01


slide-1
SLIDE 1

ISSemminaryWS00/01 1

TheImpactofAspect-Oriented ProgrammingonFuture ApplicationDesign

AndreiPopovici InformationandCommunicationResearchGroup ISSeminarJan.17th,2001

slide-2
SLIDE 2

ISSemminaryWS00/01 2

Outline

  • Thesoftwareworld

– components,objects,languages

  • Aspectsinthesoftwareworld

– theneedforaspects – whatareaspects – whentousethem – howtoworkwithaspects

  • implementationtechniques
  • availabletools
  • Theimpactofaspects

– throughoutacomponentslifetime – community-specificadaptations – application-awareenvironments(orcontexts)

  • Related

– researchareasandCStopics

SE,PL Ubi

slide-3
SLIDE 3

ISSemminaryWS00/01 3

Thesoftwareworld

  • Component:

– unitofindependentdeployment – hasnopersistentstate – subjectto3rdpartycomposition

» [1]

  • Object:

– unitofinstantiation – encapsulatesstate&behavior – uniqueidentity

Intro Aspects Applications Related Intro Aspects Applications Related

slide-4
SLIDE 4

ISSemminaryWS00/01 4

Decomposingcomponents

  • Component:typicallyconstructedusingone

language

  • Maindecompositionparadigm

– functional,object-oriented – thetyrannyofthedominantdecomposition

» [2]

  • Inpractice:adeployedcomponentconsistsof

manyobjects

Deployment∈ ComponentLifecycle

Intro Aspects Applications Related Intro Aspects Applications Related

slide-5
SLIDE 5

ISSemminaryWS00/01 5

Preamble

Whatistherealworldsecurity-aspectofmylife?

– lockthedoorofmyflatinthemorning – unlockoffice,unlockterminalatwork – lockscreen&lockofficeintheevening – unlockthedoorofmyplace..

1.Softwareworld, Component 2.Softwareaspect 3.Component lifetime Aspect~adspecere(lat.) – tolookat – particular appearancetoeye

  • rmind

Aspect~adspecere(lat.) – tolookat – particular appearancetoeye

  • rmind

Intro Aspects Applications Related Intro Aspects Applications Related

slide-6
SLIDE 6

ISSemminaryWS00/01 6

Aspectsmotivation

  • tyrannyofthemaindecompositionunit(OO)
  • Someconcernscannotbeexpressedina

modularway

– Whereislogginginorg.apache.tomcat?

  • Notinoneplace
  • Noteveninafew
  • Notinrelatedplaces
  • Notinoneplace
  • Noteveninafew
  • Notinrelatedplaces

Intro Aspects Applications Related Intro Aspects Applications Related

slide-7
SLIDE 7

ISSemminaryWS00/01 7

Costoftangledcode

  • Redundancy

– samefragmentinmoreplaces

  • Difficulttoreasonabout

– thebig-pictureoftanglingis notclear

  • Difficulttochange

– havetofindallthecode involved – thetobesuretochangeit consistently

» [3]

Intro Aspects Applications Related Intro Aspects Applications Related

slide-8
SLIDE 8

ISSemminaryWS00/01 8

AOP=..

  • Aspectsarewell-modularizedcrosscutting

concerns

  • Crosscuttingconcerns

– haveaclearpurpose – definemoduleboundaries,linesofdata-flow,set

  • fmethods,pointsofresourceutilization
  • Weaving:addaspectfunctionalitytoexisting

component

– hundredsofplaceschangedatatime Aspect + =

Intro Aspects Applications Related Intro Aspects Applications Related

slide-9
SLIDE 9

ISSemminaryWS00/01 9 pointcuttouche(ctx):(ContextManager|BaseInterceptor)& receptions(*addContext(Contextctx)) aftertrackCtxChanges:touche(ctx) {Logger.log(“Contextchangedto”+ctx);} pointcuttouche(ctx):(ContextManager|BaseInterceptor)& receptions(*addContext(Contextctx)) aftertrackCtxChanges:touche(ctx) {Logger.log(“Contextchangedto”+ctx);} EachtimeContextManagerorBaseInterceptorreceivesan addContextcall EverythingwhichhappensintheclassContextManager Actiontotakeeverytimeapointdefinedbythecrosscut‘ touche’ isreached

AOPexample

  • Problem:trackcontextchanges

(tomcatexample)

ContextManager addContext BaseInterceptor addContext Intro Aspects Applications Related Intro Aspects Applications Related

slide-10
SLIDE 10

ISSemminaryWS00/01 10

AOPtaxonomy

  • Joinpoints=allrelevantpointsinthe

executionofaprogram

  • Pointcuts=anamedsetofjoin-points(S)

– S&S,S|S,(S),!S

  • Aspect=pointcut+adviceaction
  • Adviceaction=similartocomponentblock

Intro Aspects Applications Related Intro Aspects Applications Related

slide-11
SLIDE 11

ISSemminaryWS00/01 11

Pointcutdefinitions

Someexamplesofprimitivepointcuts:

– *addContext(Context) matchesCtxMgr.addContext(Context) – **(Context) matchesCtxMgr.setContext(Context) too – **(..) matchesallmethodsofallclasses – public*(..) matchesallpublicmethods – CtxMgr matcheseverythingwhichhappensin theclassCtxMgr

Actionspecificators:

– (around(before(normalexecution)after)around)finally

Intro Aspects Applications Related Intro Aspects Applications Related

slide-12
SLIDE 12

ISSemminaryWS00/01 12

AOPimplementation

  • MostimplementationsassertJavaascomponent

language

  • Sourcepreprocessing

– semanticallyawarepreprocessor(AspectJ[5],HyperJ[4])

  • Objectinstrumentation

– changeobject-codeatload-time – e.g.,exchangeclass-loaderintheJVM(JOIE[6])

  • Monitoredruntimeenvironment

– Prose

BytecodetransformationexampleforJava Component classfiles Bytecode transformation rules Intro Aspects Applications Related Intro Aspects Applications Related

slide-13
SLIDE 13

ISSemminaryWS00/01 13

AOPusage

  • AOPisusedfor:

– synchronization(e.g.,COOL[7]) – logging,errorhandling – distributionconcerns(e.g.,RIDL[7]) – contracts(pre-andpost-conditions)

  • ..andcouldbeusedfor:

– contextsensitiveness – transactionalprocessing – join/setup/leave/teardownactions

Intro Aspects Applications Related Intro Aspects Applications Related

slide-14
SLIDE 14

ISSemminaryWS00/01 14

WhentouseAOP

  • thelifecycleofacomponent-

Designand implementation

release

Deployment environment

delivery

Adapt.

Changefactors

Deployment adaptations

Lateadaptations

Aspectsarecurrently usedinthisstage Intro Aspects Applications Related Intro Aspects Applications Related

slide-15
SLIDE 15

ISSemminaryWS00/01 15

AOPforlateadaptations

  • Lateadaptationsinresponsetoenvironment

changes

  • Environmentchanges:

– policy/organizationalchanges

  • accesscontrol,security,privacy

– specialcase:informationspaces,mobilecomputing

  • recurringdeployment-likeadaptations

– service/usage-specific

  • principalinitiatingaservicecall
  • timeandcontextofaservicecall

– asynchronousenvironmentchanges

  • location,levelofservice,usageofsystemresources

Intro Aspects Applications Related Intro Aspects Applications Related

slide-16
SLIDE 16

ISSemminaryWS00/01 16

Scenarioslike..(1)

Idon’t undestand

  • Communityspecifickeys,encryptionalgorithmsandrules

(K,f) (K,f) (K,f) Intro Aspects Applications Related Intro Aspects Applications Related

slide-17
SLIDE 17

ISSemminaryWS00/01 17

Scenarioslike..(2)

Getpart#2 Getsub-part#A,#B GetSWY

  • UploadMini-TM

functionalityin eachnodeofthe community

  • Glue(normal)

servicecallswith TMcoordination

  • Control

resources ..anopen-airfair-trade

GetSWX

  • ..byinsertingacoordinationaspectintothe

participant’scomponent

Intro Aspects Applications Related Intro Aspects Applications Related

slide-18
SLIDE 18

ISSemminaryWS00/01 18

Scenarioslike..(3)

  • Aroboticenvironment:

– remotecontrolleddevices+sensors

  • ConsiderJINIsetupforLegoMindstorms

» [8,9]

  • Weaveanaspectintoallproxiesofall

servicesthatlogs

– whatcommandswereissued,atwhatpointin time,bywhom

  • Applications:

– replaypartsofthehistory

– querythepast(isthisafactoidaspect?) – performinverseoperations

Intro Aspects Applications Related Intro Aspects Applications Related

slide-19
SLIDE 19

ISSemminaryWS00/01 19

A.O.Contexts

  • Application-aware-context:

– basestation(associatedtothecontext)uploads andweavesatruntime(dynamically)aspectsinto allcomponentsjoiningtheenvironment – withdrawaspectsatruntime

  • Contextawareness:
  • Manyofthecurrentapproaches:

– intelligence(adaptationcapability)locatedinthe mobilesystem – contextispassive(e.g.,provideslocation-info)

allowsamobilecomputingdevicetoadapttochangingenvironmentconditions allowsamobilecomputingdevicetoadapttochangingenvironmentconditions

Intro Aspects Applications Related Intro Aspects Applications Related

slide-20
SLIDE 20

ISSemminaryWS00/01 20

Community-specific adaptations

  • Community-specificadaptations

– agroupofnodesdecidesdecidestoconsistently changeitsbehavior(e.g.,virtualcommunity)

  • AOPseemstobeagoodchoice

– consistentchanges – doaspectshavetobecomponent-specific[11]?

  • What’sthecompetitiondoing?

– designpatternsforconsistentchanges(factory)(-) – replacementofimplementation/libraries(--)

Intro Aspects Applications Related Intro Aspects Applications Related

slide-21
SLIDE 21

ISSemminaryWS00/01 21

Relatedwork

  • EnterpriseJavaBeans

– deploymentadaptations

  • CorbaQOS

– systempropertiesaroundfunctionalcalls[11]

  • Meta-ObjectProtocols

– openlanguagedefinitions(inpractice:extremely abstractandhardtounderstand)[10]

  • Configurable/openoperatingsystems

Intro Aspects Applications Related Intro Aspects Applications Related

slide-22
SLIDE 22

ISSemminaryWS00/01 22

Discussion

  • Impactonapplicationdevelopment?
  • Whatadaptationsarereallyorthogonal?
  • Howtodealwithcomponent-specific

adaptations

  • Securityproblemsforrun-timeextensions?
  • TowhatextentisAOPrelevantforaworldin

whichcomputerusetendstobecome pervasive?

  • Whataboutadaptationsof(dumb)devices?

Intro Aspects Applications Related Intro Aspects Applications Related

slide-23
SLIDE 23

ISSemminaryWS00/01 23

Who’swho

  • XeroxParc:AspectJ

– Kikzales,Lopes

  • U.ofTwente:compositionfilters(Sina)

– Aksitetal.

  • IBM:HyperJ/multidimensionalsep.ofconcerns

– Osherr,Tarr

  • N.E.U:adaptiveapplications

– Lieberherr

Intro Aspects Applications Related Intro Aspects Applications Related

slide-24
SLIDE 24

ISSemminaryWS00/01 24

References

  • [1]SzyperskyC:ComponentSoftware,BeyondObject-OrientedProgramming

,Addison- Wesley,1997,

  • [2]P.Tarr,HOsherr,W.Harryson,S.Sutton:NDegreesofSeparation:Multi-Dimensional

SeparationofConcerns.Proceedingsofthe21stInternationalConferenceonSoftware Engineering,May1999

  • [3]http://aspectj.org/documentation/papersAndSlides/OOPSLA-2000-demo_files/frame.htm
  • [4]http://www.research.ibm.com/hyperspace/HyperJ/HyperJ.htm
  • [5]http://www.aspectj.org
  • [6]TheJavaObjectInstrumentationEnvironment--http://www.cs.duke.edu/ari/joie/
  • [7]D:AlanguageFrameworkforDistributedProgrammingTechnicalReport

,XeroxPalo AltoResearchCenter,NumberSPL97-010,P9710047,February1997.

  • [8]http:www.legominstorms.de
  • [9]JanNewmarch:JiniandMindstorms,www.canberra.edu.au/java/mindstorms
  • [10]GregorKiksales:TheArtofMeta-ObjectProgramming
  • [11]J.Zinky,D.Bakken,R.Schantz:ArchitecturalSupportforQualityofServiceofCORBA

Objects.TheoryandPracticeofObjectSystems,April1997 Intro Aspects Applications Related Intro Aspects Applications Related

slide-25
SLIDE 25

ISSemminaryWS00/01 25

Theend?

slide-26
SLIDE 26

ISSemminaryWS00/01 26

AspectJCaseStudy

Ad-HocAccessControlonPrinter Services