Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)

Info icon This preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright W. Howden 1 Lecture 5: Collaboration Diagrams
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright W. Howden 2 Collaboration Diagrams Used for design of: components, object, subsystems Diagrams show entity event responses • Event receiving a message
Image of page 2
Copyright W. Howden 3 Collaboration Diagram Components • Objects • Messages – One object sends a message to another message Collection of interacting objects, as they accomplish some kind of functionality
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright W. Howden 4 2b: [userName=/ name] result :="Not logged on" 3b: [2a & memberData == null] result = "NotAMember" 5: [2a & 3a] result = "UpdateMade" 2a: [userName==name] memberData = getMemberData(userName) 4: [2a & 3a] updateMemberData(memberData) 1: userName = getUserName() result = setMemberData (name, dateeData) :String dL : DomainLogic dB : DataBase logOn : LogOn memberData : MemberData 3a: [2a & memberData/= null] setDateeData(dateeData) Domain (Business) Logic subsystem updates a member's data
Image of page 4
Copyright W. Howden 5 Message Sequence Notation Multiple schemes, better depending on situation. Will use modified decimal notation Don’t number first message, we are showing how the object responds to this initial event Complicated situations: Conditional branching Nesting of (sub) operations Compound conditionals
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright W. Howden 6 Notation: Conditionals Alternative choices of message flows Precede messages with constraints/guards – E.g. [userName == name] ……. Use lettered notation to indicate alternative message flows – E.g. 1a, 1b
Image of page 6
Copyright W. Howden 7 Conditionals Example Used to indicate choices based on specified conditions. Either 1a or 1b is done, then 2 is done Object1 Object2 Object3 1a : [ co nd ] m1 ( ) 1b:[not cond] m2() Object4 2: m 3 ( ) Object5
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright W. Howden 8 Nesting and Sub-Operations Nested inside the response to message m1, is the sending of messages m2 then m3, done before “returning” from m1 Object1 Object2 Object3 Object4 1: m1() 1.1: m2() 1.2: m3() Object5
Image of page 8
Copyright W. Howden 9 Compound Conditions How to number structures such as if a then if b then {c, d} else e else g Nested numbering already used up for sub- operation nesting so just repeat the condition somehow
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright W. Howden 10 2b: [userName=/ name] result :="Not logged on" 3b: [2a & memberData == null] result = "NotAMember" 5: [2a & 3a] result = "UpdateMade" 2a: [userName==name] memberData = getMemberData(userName) 4: [2a & 3a] updateMemberData(memberData) 1: userName = getUserName() result = setMemberData (name, dateeData) :String dL : DomainLogic dB : DataBase logOn : LogOn memberData : MemberData 3a: [2a & memberData/= null] setDateeData(dateeData) Domain (Business) Logic subsystem updates a member's data
Image of page 10
Copyright W. Howden 11 Other Possible
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern