Object-Oriented Modelling and Interaction Diagrams Quiz
29 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

How are object creation and destruction typically represented in a communication diagram?

  • {add} and {remove}
  • {create} and {delete}
  • {new} and {destroyed} (correct)
  • {start} and {end}
  • In a collaboration diagram, how are message-sends typically represented?

  • As vertical lines
  • As lines with arrowheads
  • As horizontal lines (correct)
  • As dashed lines
  • What is the purpose of the multi-stage numbers (1.1) in a communication diagram?

  • Indicate message sequencing (correct)
  • Represent object lifelines
  • Replace vertical position in a sequence diagram
  • Specify object destruction
  • What does each message in a collaboration diagram have to help with sequencing?

    <p>A multi-stage number</p> Signup and view all the answers

    How does a collaboration diagram differ from an object diagram?

    <p>It includes object creation and destruction</p> Signup and view all the answers

    Which diagram type uses {new} and {destroyed} to indicate object creation and destruction?

    <p>Communication Diagram</p> Signup and view all the answers

    What do the lines between classes on UML communication diagrams represent?

    <p>Relationships (associations, composition, dependencies, or inheritance) between the classes</p> Signup and view all the answers

    Why are details of associations, such as their multiplicities, not modeled on UML communication diagrams?

    <p>Because this information is contained on the class diagrams</p> Signup and view all the answers

    How are messages depicted on UML communication diagrams?

    <p>As labeled arrows indicating the direction of the message</p> Signup and view all the answers

    Which diagram type provides visual summaries of individual use cases?

    <p>System Sequence Diagrams (SSD)</p> Signup and view all the answers

    What is the main focus of a System Sequence Diagram (SSD)?

    <p>Events crossing the system boundary from actors to systems</p> Signup and view all the answers

    What format should sequence numbers be in on UML communication diagrams?

    <p>A.B.C.D</p> Signup and view all the answers

    Which diagram type is specified to contain information about multiplicities in associations?

    <p>Class Diagrams</p> Signup and view all the answers

    In SSD, why are all systems treated as black boxes?

    <p>To focus on external interactions and events</p> Signup and view all the answers

    When should a System Sequence Diagram (SSD) be created for a use case?

    <p>For the main success scenario and frequent or complex alternative scenarios</p> Signup and view all the answers

    What should a System Sequence Diagram (SSD) specify and show?

    <p>External actors and messages invoked by them</p> Signup and view all the answers

    What are the first two design decisions to be made when constructing interaction diagrams?

    <p>Which message should be sent from the interface and to which object should the interface send the message</p> Signup and view all the answers

    What does an SSD emphasize in terms of system events?

    <p>Events generated by external actors crossing the system boundary</p> Signup and view all the answers

    Why is it important to draw a System Sequence Diagram (SSD) for each use case?

    <p>To model interactions between the system and actors</p> Signup and view all the answers

    What is the strategy of 'One Central Class' in implementing use-cases?

    <p>Sending all messages from the interface to a single object</p> Signup and view all the answers

    What is the purpose of 'One Central Class' strategy in interface design?

    <p>To minimize the knowledge the interface must have of the business model</p> Signup and view all the answers

    Which class receives messages from the user interface in 'Actor Class' strategy?

    <p>Objects based on specific actors' roles</p> Signup and view all the answers

    In OO modelling, what are some main system events for the 'Buy a Beverage' use case?

    <p>Insert coins(), Enter choice(), Offer Choices</p> Signup and view all the answers

    How does 'One Central Class' strategy help with user interface design?

    <p>By reducing dependency on business rules</p> Signup and view all the answers

    What is the primary difference between the fork and cascade patterns?

    <p>In the fork pattern, the Company class directly interacts with both Job and Person classes, while in the cascade pattern, the Company class only interacts with the Job class.</p> Signup and view all the answers

    What is a reasonable position regarding the cascade pattern?

    <p>The Job class should know about the existence of the Person class but not specific attributes like age.</p> Signup and view all the answers

    Which pattern would be more appropriate if the Company class needs to access multiple attributes of the Person class?

    <p>The fork pattern would be more appropriate as it allows direct access to the Person class.</p> Signup and view all the answers

    Which of the following statements about the cascade pattern is true?

    <p>It promotes information hiding by limiting the Company class's direct access to the Person class.</p> Signup and view all the answers

    What is a potential drawback of the fork pattern?

    <p>It does not provide a clear separation of concerns between the Job and Person classes.</p> Signup and view all the answers

    Study Notes

    UML Communication Diagrams

    • The same notation for classes and objects is used on UML sequence diagrams and UML communication diagrams.
    • Lines between classes represent relationships (associations, composition, dependencies, or inheritance) between them.
    • Details of associations, such as multiplicities, are not modeled because this information is contained on the class diagrams.
    • Messages are depicted as a labeled arrow that indicates the direction of the message, using a notation similar to that used on sequence diagrams.

    Message Notation

    • Optionally, you may indicate the sequence number in which the message is sent, indicate an optional return value, and indicate the method name and the parameters (if any) passed to it.
    • Sequence numbers should be in the format A.B.C.D to indicate the order in which the messages were sent.

    System Sequence Diagrams (SSD)

    • SSDs are visual summaries of the individual use cases.
    • Prepare a system sequence diagram for each important exception.
    • SSDs show the events that external actors generate, their order, and possible inter-system events.
    • All systems are treated as a black box; the diagram places emphasis on events that cross the system boundary from actors to systems.

    Use Case Models

    • A system sequence diagram should be prepared for the main success scenario of the use case and frequent or complex alternative scenarios.
    • A system sequence diagram should specify and show the following:
      • External actors
      • Messages (methods) invoked by these actors
      • Return values (if any) associated with previous messages
      • Indication of any loops or iteration area

    Design Issues

    • Three strategies for choosing which objects are to receive messages from the user interface:
      • One Central Class
      • Actor Class
      • Use-Case class

    One Central Class Strategy

    • Making the interface send all messages to a single object – usually some general object like a System or Hotel – who will in turn forward message to the concerned object.
    • Advantages:
      • Minimizing the knowledge the interface must have of the business model
      • Minimizing the dependency of the user interface on the rules and concepts of the business domain.

    Forks and Cascades

    • Fork pattern: where Company can send a message to Job to get back person, then send message to Person to get the age.
    • Cascade pattern: Company sends getAgeofPerson() to Job class, where Job class sends another message getAge() to Person class.
    • No direct interaction between Company and Person.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge on object lifelines, objects creation and destruction, messages, returns, activation boxes, conditional messages, conditions, iterations, messages to 'self' or 'this', and sequence diagrams. Includes an example sequence diagram.

    More Like This

    Use Quizgecko on...
    Browser
    Browser