Aspectual Components Implementation: Examples

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Aspectual Components Implementation: Examples - Presentation Transcript

    1. Aspectual Component Implementation Examples
    2. ComponentPackage Component Participant expectedOp() Op(){expectedOp(); getHost()} getHost() ConnectorPackage HostPackage Host // to play role of participant toModify(){} // to be mapped to Op() 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. “ outer.super.toModify()” simulated with aux() is not elegant MyHost toModify(){part.Op();}// override aux(){super.toModify()} part ParticipantAnonymousExtended expectedOp(){aux()} getHost(){MyHost.this} main(){new MyHost().toModify() }
    3. ComponentPackage Component Participant expectedOp() Op(){expectedOp(); getHost()} getHost() ConnectorPackage MyHost toModify(){part.Op();} aux(){super.toModify()} part HostPackage ParticipantAnonymousExtended expectedOp(){aux()} getHost(){MyHost.this} main(){new MyHost().toModify() } Host toModify(){} Does it work with multiple participants? With multiple hosts? Looks like. Problem: when we have a Host-object and want to get modified behavior, need to create a MyHost object.
    4. ComponentPackage Component Participant expectedOp() Op(){expectedOp ??? (); getHost()} getHost() ConnectorPackage 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? part2 ParticipantAnonymousExtended expectedOp2(){aux2()} getHost(){MyHost.this} main(){new MyHost().toModify2() } toModify2(){part2.Op();}//override aux2(){super.toModify2()} ParticipantAnonymousExtended expectedOp1(){aux1()} getHost(){MyHost.this} main(){new MyHost().toModify1() } MyHost toModify1(){part1.Op();}//overrride aux1(){super.toModify1()} part1
    5. ComponentPackage Component Participant rOp(Method expOp) {expOp.invoke(); getHost();} getHost(); ConnectorPackage HostPackage Host // to play role of participant toModify(){} // to be mapped to rOp() Mira’s modified inner class solution. MyHost toModify(){part.rOp(“toModify”);} part ParticipantAnonymousExtended getHost(){MyHost.this} main(){new MyHost().toModify() }
    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

    + mukhtarhudayamukhtarhudaya, 8 months ago

    custom

    151 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 151
      • 151 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories