1 / 6

Aspectual Component Implementation

Aspectual Component Implementation. Examples. ConnectorPackage. ComponentPackage. MyHost toModify(){part.Op();}// override aux(){super.toModify()} part. Component. Participant expectedOp() Op(){expectedOp(); getHost()} getHost(). ParticipantAnonymousExtended

lsoler
Télécharger la présentation

Aspectual Component Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aspectual Component Implementation Examples

  2. ConnectorPackage ComponentPackage MyHost toModify(){part.Op();}// override aux(){super.toModify()} part Component Participant expectedOp() Op(){expectedOp(); getHost()} getHost() ParticipantAnonymousExtended expectedOp(){aux()} getHost(){MyHost.this} main(){new MyHost().toModify() } “outer.super.toModify()” simulated with aux() is not elegant Johan’s solution 1 based on Mira’s inner class solution. Modification interface is represented also by abstract class, not by Method argument as proposed by Mira. HostPackage Host // to play role of participant toModify(){} // to be mapped to Op()

  3. ConnectorPackage ComponentPackage MyHost toModify(){part.Op();} aux(){super.toModify()} part Component Participant expectedOp() Op(){expectedOp(); getHost()} getHost() ParticipantAnonymousExtended expectedOp(){aux()} getHost(){MyHost.this} main(){new MyHost().toModify() } Problem: when we have a Host-object and want to get modified behavior, need to create a MyHost object. Does it work with multiple participants? With multiple hosts? Looks like. HostPackage Host toModify(){}

  4. ConnectorPackage ComponentPackage MyHost toModify1(){part1.Op();}//overrride aux1(){super.toModify1()} part1 Component Participant expectedOp() Op(){expectedOp???(); getHost()} getHost() ParticipantAnonymousExtended expectedOp1(){aux1()} getHost(){MyHost.this} main(){new MyHost().toModify1()} part2 ParticipantAnonymousExtended expectedOp2(){aux2()} getHost(){MyHost.this} main(){new MyHost().toModify2()} More complex connector: one host but multiple methods are modified. Which expectedOp should be called in the participant? Is this why Mira’s implementation is more complex? toModify2(){part2.Op();}//override aux2(){super.toModify2()}

  5. ConnectorPackage ComponentPackage MyHost toModify(){part.rOp(“toModify”);} part Component Participant rOp(Method expOp) {expOp.invoke(); getHost();} getHost(); ParticipantAnonymousExtended getHost(){MyHost.this} main(){new MyHost().toModify() } HostPackage Host // to play role of participant toModify(){} // to be mapped to rOp() Mira’s modified inner class solution.

  6. Implementations • Implement Datastructure/Counter/Lock example • without reflection • with reflection • apply to both Queue and Stack • Implement ShowRWAccess example: simulate inheritance between components and connectors in Java • without reflection • with reflection • map readOp to two methods of two different application classes

More Related