Object-Oriented Modelling and Interaction Diagrams Quiz

WorldFamousMotif avatar
WorldFamousMotif
·
·
Download

Start Quiz

Study Flashcards

29 Questions

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

{new} and {destroyed}

In a collaboration diagram, how are message-sends typically represented?

As horizontal lines

What is the purpose of the multi-stage numbers (1.1) in a communication diagram?

Indicate message sequencing

What does each message in a collaboration diagram have to help with sequencing?

A multi-stage number

How does a collaboration diagram differ from an object diagram?

It includes object creation and destruction

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

Communication Diagram

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

Relationships (associations, composition, dependencies, or inheritance) between the classes

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

Because this information is contained on the class diagrams

How are messages depicted on UML communication diagrams?

As labeled arrows indicating the direction of the message

Which diagram type provides visual summaries of individual use cases?

System Sequence Diagrams (SSD)

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

Events crossing the system boundary from actors to systems

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

A.B.C.D

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

Class Diagrams

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

To focus on external interactions and events

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

For the main success scenario and frequent or complex alternative scenarios

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

External actors and messages invoked by them

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

Which message should be sent from the interface and to which object should the interface send the message

What does an SSD emphasize in terms of system events?

Events generated by external actors crossing the system boundary

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

To model interactions between the system and actors

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

Sending all messages from the interface to a single object

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

To minimize the knowledge the interface must have of the business model

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

Objects based on specific actors' roles

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

Insert coins(), Enter choice(), Offer Choices

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

By reducing dependency on business rules

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

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.

What is a reasonable position regarding the cascade pattern?

The Job class should know about the existence of the Person class but not specific attributes like age.

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

The fork pattern would be more appropriate as it allows direct access to the Person class.

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

It promotes information hiding by limiting the Company class's direct access to the Person class.

What is a potential drawback of the fork pattern?

It does not provide a clear separation of concerns between the Job and Person classes.

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.

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.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser