Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman.

Similar presentations


Presentation on theme: "1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman."— Presentation transcript:

1 1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman

2 2 Connection between SSDs, System Operations and Layers In a well-designed layered architecture that supports high cohesion and a separation of concerns, the UI layer objects will then forward the request from the UI layer onto the domain layer for handling.

3 How design objects? Code : Design while coding Draw, then code : UML on a whiteboard, then switch to code Only draw: tools generate everything from diagrams. 3

4 WSEP 06 Designing Objects Static and dynamic modeling. Two kinds of object models: Static models : Class diagrams / Package diagram / Deployment diagram Helps design definition of packages, class name, attributtes and method signature Dynamic models : Interaction Diagrams/ (Sequence / comunication). State machine diagrams/activity diagram Illustrate how objects collaborate via messages and methdos. They help design the logic and method bodies

5 5 Agile modeling practice  Create Models in parallel! ( interaction diagram and class diagram)  Modeling with others

6 6 UML INTERACTION DIAGRAMS Chapter 15 Applying UML and Patterns -Craig Larman

7 Sequence Diagrams 7 A First Look at interaction Diagrams Illustrate how objects interacts with each other. Emphasizes time ordering of messages. Can model simple sequential flow, branching, iteration (loop), …etc Sequence / communication

8 sequence diagram Each new object is added to the right Method of Object A Class A has an attribute of type B to be able to call doTwo and doThree. Methods of Object B

9 Code public class A { private B myB= new B(); Public void doOne() { myB.doTwo(); myB.doThree(); } Class A has an attribute of type B. Class A has a method named doOne Class B has methods named doTwo and doThree

10 Communication diagram

11 Interaction Diagram notation

12 Common UML Interraction diagram notation lifeline

13 Basic Sequence diagram n o tation

14 How to illustrate a return result ? Is equivalent to

15 Messages sent to itself

16 Creation of Instances Dashed line Sale class will invoke the new operator and call the constructor.

17 Object destruction

18 Conditional message : OPT frame is placed around one or more messages. opt : Optional fragment that execute if guard [color=red] is true

19 Conditional message : UML1.x notation

20 which notation do you prefer?

21 Loops (iteration over a collection)

22 Code page 234 22

23 Loops (iteration over a collection)

24 Which notation do you prefer

25 Nesting of frames 25

26 How relate Interaction diagram? 26

27 Invoke static (class)methods 27

28 Polymorphism in interaction diagrams? 28

29 UP artifacts influencing OO design

30 Questions? 30

31 aMember: BookBorrower theLibraryMember: LibraryMember theCopy: CopytheBook: Book borrow (theCopy) 1: okToBorrow 2: borrow 2.1:borrowed Can you guess the scenario from this interaction diagram ?

32 Collaboration diagram: Library System


Download ppt "1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman."

Similar presentations


Ads by Google