1 / 21

AP Book View of AOP

AP Book View of AOP. AP Book = Adaptive Object-Oriented Software Development, published August 1995 by PWS. AP Book Definition. Definition of AOP: "Adaptive software is specified in terms of complementary, collaborating views, each one addressing a different concern of the application.".

jsaleh
Download Presentation

AP Book View of AOP

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. AP Book View of AOP AP Book = Adaptive Object-Oriented Software Development, published August 1995 by PWS. Early AOP definition

  2. AP Book Definition • Definition of AOP: "Adaptive software is specified in terms of complementary, collaborating views, each one addressing a different concern of the application." Early AOP definition

  3. AP Book Definition • What does “collaborating views” mean: For the special case of two views V1 and V2: "An element v1 of V1 is formulated in terms of partial information about elements of V2." Early AOP definition

  4. AP Book Definition • Comments: • The Xerox PARC definition distinguishes components and aspects. • We call both components and aspects views. A component is considered a “behavioral view”. Early AOP definition

  5. AP Book Definition • Comments: • The Xerox PARC definition of AOP stresses the importance of “cross-cutting”. • The word "cross-cut" does not show up here but it is implied: The partial information used from one view V may be spread out all over V. Early AOP definition

  6. Cross-cutting in AOP v2 in V2 Partial Information v1 in V1 The partial information of v2 referred to in v1 is spread in v2. v1 adds to v2. Early AOP definition

  7. Careful Formulation Formulated for a family of views called V2. • "An element v1 of V1 is formulated in terms of partial information about elements of V2." Early AOP definition

  8. Example: Write accesses • Example from AspectJ tutorial. • Show write accesses Early AOP definition

  9. View v2 = component Example: Write accesses class Point { int _x = 0; int _y = 0; void set(int x, int y) { _x = x; _y = y; } void setX(int x) { _x = x; } void setY(int y) { _y = y; } int getX(){ return _x; } int getY(){ return _y; } } View v1 = aspect aspect ShowAccesses { staticbefore Point.set, Point.setX, Point.setY { System.out.println(“W”); } } Early AOP definition

  10. Example: Bus Route • Adaptive Programming • Printing persons waiting at some bus stop in bus route Early AOP definition

  11. Example: Bus Route v2 = Class graph View v1 = Adaptive program Early AOP definition

  12. Adaptive Program BusRoute { traversalwaitingPersons(PersonVisitor) { through BusStop to Person; } // from is implicit int printWaitingPersons() // traversal/visitor weaving instr. = waitingPersons(PrintPersonVisitor); PrintPersonVisitor { before Person (@ … @) … } PersonVisitor {init (@ r = 0; @) … } Early AOP definition

  13. find all persons waiting at any bus stop on a bus route Class Graph from BusRoute through BusStop to Person busStops BusRoute BusStopList buses 0..* BusStop BusList waiting 0..* passengers Bus PersonList Person 0..* Early AOP definition

  14. find all persons waiting at any bus stop on a bus route Class Graph 2 from BusRoute through BusStop to Person villages BusRoute BusStopList buses VillageList busStops 0..* 0..* BusStop BusList Village waiting 0..* passengers Bus PersonList Person 0..* AOOP / Demeter

  15. Indirect access to partial information • The formulation of a view in terms of partial information may be indirect. Early AOP definition

  16. Indirect access to partial information Early AOP definition

  17. AP Example A B From A to * E D C Early AOP definition

  18. AOP example with APPCs class Point { int _x = 0; int _y = 0; void set(int x, int y) { _x = x; _y = y; } void setX(int x) { _x = x; } void setY(int y) { _y = y; } int getX(){ return _x; } int getY(){ return _y; } } appc ShowWAccesses { expected { Data-To-Access{* write-op(*);} } provided{ Data-To-Access { before write-op { System.out.println(“W”); } } connector connector AddShowWAccesses { connects appl, ShowWAccesses ... ShowAccesses.Data-To-Access { … write-op = set* ... } } Early AOP definition

  19. AOP example 2 with APPCs P3 P2 m m 1,k 1,1 Application participant-to-class name map Interface Class Graph Structure expected interface map P1 link-to-paths map Behavior Definition main-entry P1 ... adaptive compiler (CG-to-ICG compatability?) executable Java code Early AOP definition

  20. AOP example 2 with APPCs P3 P2 m m 1,k 1,1 Application participant-to-class name map Interface Class Graph Structure expected interface map P1 link-to-paths map Behavior Definition main-entry P1 ... adaptive compiler (CG-to-ICG compatability?) executable Java code Early AOP definition

  21. End Early AOP definition

More Related