Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 6 Project review

Similar presentations


Presentation on theme: "Lecture 6 Project review"— Presentation transcript:

1 Lecture 6 Project review
Patterns: Shopper + Structural patterns (Neeraj) Strategies: Design by Contract Use case abuse/Objectory Requirements for better design/programming languages APPCs OCL 11/13/2018 Lecture 6

2 APPC Consists of provided interface required interface implementation
methods to class-valued variables output port to other components required interface methods from class-valued variables interface to class graph: paths required input ports from other components implementation 11/13/2018 Lecture 6

3 APPC Required interface methods from class-valued variables
interface to class graph: paths required A set of traversal strategies defining a set of participants from a single source following unique paths input ports from other components 11/13/2018 Lecture 6

4 APPC Implementation methods: refer to participants methods may call
next(): result from next component next().n: result from used component n subtraversal().s: continue traversal following strategy edge s 11/13/2018 Lecture 6

5 Kinds of APPCs Visitor style Adjuster style
single-traversal collaborations Adjuster style multi-traversal collaborations 11/13/2018 Lecture 6

6 Kinds of APPCs Visitor style single-traversal collaborations
single strategy parameter, uniform single method name backbone of collaboration calls subtraversal().s // follow down strategy edge s 11/13/2018 Lecture 6

7 Kinds of APPCs Adjuster/Contract style multi-traversal collaborations
several strategy parameters no calls to subtraversal().s 11/13/2018 Lecture 6

8 Role of strategy graph At some class A we don’t call next() only subtraversal().x and subtraversal().y with any Java code in between. Strategy graph describes where we might traverse: is the case anyway with around methods. 11/13/2018 Lecture 6

9 Shopper Intent: A consumer object (shopper) obtains a collection of items from a provider object without introducing coupling between shopper and provider objects. 11/13/2018 Lecture 6

10 Shopper Example A set of collaborating application objects that implement the basic functionality A set of report/view generator objects, each generating a report or view consisting of a collection of application information items 11/13/2018 Lecture 6

11 Consumer: Provider: Shopper Application objects Before traversal:
List {x,y,z} Bag {} A: x=2 B: y=7 F: z=9 After traversal: List {x,y,z} Bag {2,7,9} 11/13/2018 Lecture 6

12 Implementation A{ Bag shopper() { to *; Bag b = new B(); before * (@
does class have something in shopping list: append host to return b; }} 11/13/2018 Lecture 6

13 Implementation A{ Bag shopper() { to {A,B,F}; Bag b = new B();
before A append host.get_x() to ... return b; }} 11/13/2018 Lecture 6

14 Strategies Definition Implementation 11/13/2018 Lecture 6


Download ppt "Lecture 6 Project review"

Similar presentations


Ads by Google