CS251 Lecture 6: UML and OO Modelling
24 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

What does UML stand for in software engineering?

Unified Modeling Language

Which of these is a type of UML diagram used to describe the functional behavior of a system?

  • Sequence diagram
  • Class diagram
  • State diagram
  • Use case diagram (correct)

Which of these is a type of UML Diagram that describes the static structure of a system?

  • Use case diagram
  • Class diagram (correct)
  • Activity diagram
  • Sequence diagram

Which of these is a type of UML dynamic diagram?

<p>Sequence diagram (A)</p> Signup and view all the answers

UML static modeling only focuses on the interaction between objects, not the overall structure of the system.

<p>False (B)</p> Signup and view all the answers

Communication (Collaboration) diagrams and sequence diagrams are semantically equivalent.

<p>True (A)</p> Signup and view all the answers

Which UML diagram explicitly shows the time relationship between object interactions?

<p>Sequence diagram (D)</p> Signup and view all the answers

Which of these is a strength of collaboration diagrams?

<p>Clear representation of object interactions (C)</p> Signup and view all the answers

What does an object lifeline represent in a sequence diagram?

<p>The life span of an object during the interaction</p> Signup and view all the answers

A stereotyped message <> is used to indicate explicit deletion of an object.

<p>True (A)</p> Signup and view all the answers

What is the purpose of activation boxes in a sequence diagram?

<p>To indicate when an object is actively processing a message</p> Signup and view all the answers

Which of these elements is NOT specifically used to represent conditions or iterations in a sequence diagram?

<p>for (B)</p> Signup and view all the answers

Sending a message to 'self' or 'this' within an object is a common practice in object-oriented programming to invoke a method within the same object.

<p>True (A)</p> Signup and view all the answers

What is the purpose of a system sequence diagram (SSD)?

<p>To represent a visual summary of a particular use case</p> Signup and view all the answers

Which of the following is NOT typically included in a system sequence diagram?

<p>Internal object collaborations (E)</p> Signup and view all the answers

What is the primary purpose of constructing system sequence diagrams?

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

When designing software to handle use cases, what is 'One Central Class' strategy?

<p>All messages are sent to a single central class, which then delegates to other classes (C)</p> Signup and view all the answers

What is the main disadvantage of the 'One Central Class' strategy?

<p>Increased complexity of the central class (A)</p> Signup and view all the answers

Which strategy for implementing use cases sends messages directly to actor classes?

<p>Actor Class (B)</p> Signup and view all the answers

What is the main disadvantage of the 'Actor Class' strategy?

<p>Limited reusability of actor classes across different systems (B)</p> Signup and view all the answers

Which strategy for implementing use cases focuses on a dedicated class for each use case?

<p>Use-Case Class (D)</p> Signup and view all the answers

What is the main disadvantage of the 'Use-Case Class' strategy?

<p>It can increase the number of classes in the system. (D)</p> Signup and view all the answers

When designing an interaction diagram, how does a 'fork' pattern manage interactions?

<p>Centralizes control within the sending object. (A)</p> Signup and view all the answers

When designing an interaction diagram, how does a 'cascade' pattern manage interactions?

<p>Delegates the responsibility to another object. (C)</p> Signup and view all the answers

Flashcards

Interaction Diagrams

UML diagrams used to visualize how objects in a system interact through messages, showing their dynamic behaviour.

Sequence Diagram

A type of interaction diagram that shows the sequence of messages exchanged between objects over time.

Collaboration Diagram

A type of interaction diagram that shows the flow of messages between objects, focusing on the connections between those objects and their roles.

System Sequence Diagram (SSD)

A visual summary of a use case depicting the interactions between an external actor and the system.

Signup and view all the flashcards

State Diagram

A visual representation of all the possible states an object can be in during its lifetime and the transitions between those states.

Signup and view all the flashcards

Activity Diagram

A UML diagram that outlines the steps in a process, illustrating the flow of activities and decisions.

Signup and view all the flashcards

Class Diagram

A graphical representation of a software system showing classes as boxes with their attributes and operations, connected by lines that represent relationships.

Signup and view all the flashcards

Object Diagram

A diagram that shows specific instances of classes (objects) at a certain point in time, their attributes, and the relationships between them.

Signup and view all the flashcards

Static Diagrams

Diagrams that represent the static structure of software systems, focusing on classes, objects, and their relationships.

Signup and view all the flashcards

Dynamic Diagrams

Diagrams that represent the dynamic behavior of a system, focusing on how objects interact and how the system changes over time.

Signup and view all the flashcards

Sequence Diagram

A type of interaction diagram where messages are ordered sequentially in time, with the vertical axis representing time and the horizontal axis representing objects involved.

Signup and view all the flashcards

Collaboration Diagram

A type of interaction diagram that emphasizes the relationships between collaborating objects, with objects depicted as boxes and messages as arrows between them.

Signup and view all the flashcards

System Sequence Diagram (SSD)

A diagram depicting the sequence of interactions between an external actor and the system, treating the system as a black box.

Signup and view all the flashcards

One Central Class Design Strategy

A strategic design approach where all messages from the user interface are sent to a single central object, typically representing the system.

Signup and view all the flashcards

Actor Class Design Strategy

A design approach that maps actors in the system to classes, with each class representing the actor and responsible for handling messages related to that actor.

Signup and view all the flashcards

Use-Case Class Design Strategy

A design approach where a separate class is created for each use case, with a method that executes the steps of that use case.

Signup and view all the flashcards

Cascade Pattern

A design pattern where an object delegates a request to another object without directly interacting with it.

Signup and view all the flashcards

Fork Pattern

A design pattern where an object sends multiple messages to different objects, often based on the results of previous messages.

Signup and view all the flashcards

Interaction Diagrams

UML diagrams that model how a system will behave when an object interacts with an external entity like a user or a resource.

Signup and view all the flashcards

Static Diagrams

UML diagrams that represent the relationships between classes and objects in a system, providing a static view of its design.

Signup and view all the flashcards

State Diagrams

UML diagrams that show how the system changes state over time, focusing on the dynamic behavior of individual objects.

Signup and view all the flashcards

Activity Diagrams

UML diagrams that focus on the flow of activities in a process, illustrating the steps, decisions, and transitions involved.

Signup and view all the flashcards

Central Interface Class

A class that is responsible for managing the interaction between the user interface and the rest of the system.

Signup and view all the flashcards

Traceability from Use Cases to Code

The practice of ensuring that every use case in the system is implemented by a corresponding method within a single class.

Signup and view all the flashcards

Reusability

The ability to reuse components of a system in different contexts or projects.

Signup and view all the flashcards

Package

A set of classes that encapsulate related functionality, providing a modular structure for the system.

Signup and view all the flashcards

Decomposition

The process of breaking down complex problems into smaller, more manageable units.

Signup and view all the flashcards

Modular Design

A design technique that emphasizes modularity, with each module having a clear purpose and interface.

Signup and view all the flashcards

Polymorphism

A concept in object-oriented programming where a single operation can be performed on different types of objects, providing flexibility and reusability.

Signup and view all the flashcards

Abstraction

A technique for managing complexity in software systems by hiding details and exposing only the essential information to external components.

Signup and view all the flashcards

Messaging

A mechanism that allows objects to communicate with each other by sending and receiving messages.

Signup and view all the flashcards

Study Notes

Lecture 6 (CS251) Software Engineering 1

  • Lecture covers Object-Oriented (OO) Modelling, Interaction Diagrams (Sequence, Collaboration, & System Sequence Diagrams)
  • Objectives of the lecture include learning the notation of interaction diagrams and how to visualize system-user interactions using different types of diagrams.
  • It also includes learning how to decide on issues like fork & cascade, and how to implement use cases.

UML Diagrams

  • Functional Diagrams (Use case diagrams): Describe the system's functional behavior from the user's perspective.
  • Static Diagrams (Class, Object, & Package diagrams): Illustrate the system's static structure, including objects, attributes, and associations.
  • Dynamic Diagrams: Include Interaction diagrams (Sequence & Collaboration diagrams) that describe the interaction between objects of the system. State diagrams that describe the dynamic behavior of an individual object. Activity diagrams that describe the dynamic system behavior, particularly the workflow.

UML Dynamic Modelling - Why?

  • UML static modeling involves use cases, activity diagrams, and class/object modelling.
  • Use cases describe the required behavior (operations) of a system, but don't specify which classes are responsible for computations.
  • Initial class models identify classes and their relationships, but lack attribute and operation detail.
  • Dynamic modelling links use cases and class modelling, showing how objects interact using messages.
  • Dynamic modelling implements the required functionality to realize a use case in the software system.

UML Dynamic Modelling: Interaction Diagrams

  • Interaction diagrams represent dynamic modelling, used for making and recording decisions related to class behavior (operations).
  • Two types of interaction diagrams are Sequence Diagrams and Communication (Collaboration) Diagrams.
  • Both types are equivalent but have different visual properties.

UML Interaction Diagrams: Sequence Versus Collaboration Diagrams

  • Sequence Diagrams: Show object interaction in time sequence with objects horizontally and time vertically.
    • Strengths: Relationship in time is extremely clear.
    • Weaknesses: Overall pattern of message flow is not easily seen.
  • Collaboration (Communication) Diagrams: Show how cooperating objects dynamically interact by sending and receiving messages.
    • Strengths: Object interactions are clear.
    • Weaknesses: Actual message sequence is not always obvious.

Sequence Diagrams

  • Show participants (objects) in an interaction (use case or part of) and the sequence of messages among them.
  • Each use case requires one or more sequence diagrams to describe its behavior.
  • Building a sequence diagram begins by considering use case interactions and the originating message.
  • Messages flow must be considered to understand which class should have the method in its protocol.
  • Use case post-conditions and alternative scenarios should also be considered.
  • Object diagrams can help visualise the before and after states of operations.

Object Lifelines

  • Object lifelines show the duration of object existence in a diagram.

Objects Creation and Destruction

  • Newly created objects are placed at their creation height.
  • The <> stereotyped message, along with a large X and short lifeline, indicates explicit object destruction.

Messages, Returns & Activation Boxes

  • Message passing between objects is displayed using arrows and boxes representing object interactions.

Conditional Messages

  • Conditional messages use a condition in brackets to influence message processing.

Conditions and Iterations

  • Diagrams can represent conditional and iterative actions (using 'alt', 'else', 'loop' blocks).

Messages to "Self" or "This"

  • Messages can be sent from an object to itself using 'self' or 'this' notation.

Sequence Diagram: Examples

  • Practical examples illustrating sequence diagrams to visualize system behavior.

Sequence Diagram: Example 2

  • More examples, showing the relationships between different system components involved in an activity.

Collaboration Diagrams

  • Collaboration diagrams are similar to sequence diagrams but prioritize displaying the messages exchanged between objects rather than time sequence.

Collaboration Diagrams - Conversion From a Sequence Diagram

  • Methods for converting sequence diagrams to collaboration diagrams are displayed.
  • The sequence of diagrams can be mapped to a collaboration diagram.

Collaboration Diagrams - Objects Creation and Destruction

  • Object creation and destruction are shown based on {new} and {destroyed} constraints in the diagram.

Collaboration Diagrams - An Example: Use Case & Class Diagrams

  • Examples of how use-case and class diagrams are connected to illustrate business roles and functions.
  • A class model diagram is given for lending books.

Collaboration Diagrams - An Example: From Static to Dynamic Modelling

  • Example of a collaboration diagram converting from a static model to describe the interaction of borrowing a book.

Collaboration Diagrams - An Example: The Sequence Diagram

  • This diagram shows the detailed sequence diagram for a book borrowing scenario.

Collaboration Diagrams - An Example: The Collaboration Diagram

  • A detailed collaboration diagram for a book borrowing scenario is illustrated.

UML Interaction Diagrams: Sequence Versus Collaboration Diagrams

  • Comparison between Sequence and Collaboration diagrams – explaining their differences (one-place for relationships; time ordering clarity).

Communication Diagram - Notation Summary

  • Notation of communication diagrams: Rectangles represent objects, lines depict relationships (associations, dependencies, etc.).

Communication Diagram - Further Examples

  • More detailed examples of communication diagrams. Several instances are given demonstrating messages exchanged between objects involved in an application.

System Sequence Diagrams (SSD)

  • SSD is a visual summary that shows the events generated by external actors, inter-system events, and the order in which these occur.
  • Emphasis is placed on events that cross system boundaries.
  • SSD should represent the main success scenario and frequent alternative scenarios.
  • SSD includes external actors, messages/methods, return values, and loop/iteration information.

Use Case Diagram of a Vending Machine

  • Diagram illustrates a vending machine system with use cases for buying beverages, scheduled maintenance, repairs and loading items, and also illustrating the corresponding actors involved.

Vending Machine Use Cases Summaries

  • These summarise the use case categories for the vending machine system, including their respective actors and functionalities.

From Use Case to System Sequence Diagram

  • Instruction on deriving system sequence diagrams from use cases, viewing the system as a black box to model its interactions with actors.
  • Key tips are provided for use case implementation - including drawing appropriate diagrams.

System Sequence Diagram for "Buy a Beverage" Use Case

  • System events for the "Buy a Beverage use case" including inserting coins, choosing an item and receiving the items, and receiving change are displayed.

Design Issues: Strategies for Implementing Use-Cases

  • Different method strategies for message handling, including one central class, actor classes, and use case classes.
  • Advantages and disadvantages of each strategy.

Design Issues: Forks & Cascades

  • Scenarios where objects need to interact without direct associations (like Company-Job-Person example).
  • Fork: Centralized control in the sender. Cascade: Sending to another object for handling.
  • Two design examples: one utilizing the fork pattern and another using the cascade pattern.

Studying That Suits You

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

Quiz Team

Description

This quiz covers key concepts from Lecture 6 of CS251 on Software Engineering, focusing on Object-Oriented Modelling and various UML diagrams. Test your knowledge on Interaction Diagrams, Use Case Diagrams, and how to visualize system-user interactions effectively.

More Like This

Lecture 6: OOM in UML Technique
16 questions

Lecture 6: OOM in UML Technique

SpellbindingHonor8285 avatar
SpellbindingHonor8285
Use Quizgecko on...
Browser
Browser