0% found this document useful (0 votes)
2 views

Unit 4 Notess

Uploaded by

aniruthprabu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unit 4 Notess

Uploaded by

aniruthprabu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Finding object using

flow of events
Describing the process of finding
objects using a Sequence Diagram
A Sequence Diagram in UML (Unified Modeling Language) is a visual
representation of how objects interact over time. It helps illustrate the
flow of messages and actions in a system to achieve a specific function,
such as finding objects. Here's how the process of finding objects can
be described using a Sequence Diagram in software design:
Identify the Participants (Objects)
In a sequence diagram, the participants are represented by vertical
lifelines. These are the objects or entities involved in the interaction.
For the process of finding objects, typical participants could include:
• User: Initiates the search for an object.
• Search Service: Handles the logic to perform the search.
• Database or Repository: Stores the objects that need to be searched.
• Object: Represents the actual object being searched for.
Define the Process Flow
The sequence diagram illustrates the order of actions. The steps for finding an object
might be:
1. User Request: The user triggers a search request (e.g., by typing in a search term or
selecting a category). This is represented by an arrow from the User to the Search
Service.
2. Search Request to Database: The Search Service processes the user’s request and
sends a query to the Database to find the object. This step is represented by an
arrow from the Search Service to the Database.
3. Database Search: The Database searches for matching objects based on the query.
It may also validate the query, check conditions, or fetch relevant data.
4. Return Results: Once the search is complete, the Database returns the results
(either a list of objects or an empty result) back to the Search Service. This is
depicted by an arrow from Database to Search Service.
5. Display Results: The Search Service processes the data (such as formatting) and
sends the results back to the User for display. This is shown as an arrow from
Search Service to User.
•.

Messages and Return Arrows

•Messages: Each arrow between participants is


labeled with the action or method being invoked
(e.g., performSearch(query) fetchData(query)
, ).

•Return Messages: Dashed arrows indicate the


return of data or results. For example, the database
might return a list of fou
Error Handling (Optional)
You can also represent error handling in the sequence diagram. For
example:
• If the Search Service does not find any matching object, it might return
a “no results” message to the User.
• If there's a failure in the database query, an error message might be
returned at any step.
Activation Boxes
Activation boxes (thin rectangles) appear on the lifeline to show when an
object is actively performing an operation. For instance:
• The Search Service has an activation box during the query processing.
• The Database will have an activation box during the search operation.
https://www.geeksforgeeks.org/unified-
modeling-language-uml-sequence-diagrams/
Describing the process of finding
objects using a Collaboration
Diagram in software
A Collaboration Diagram designDiagram)
(also known as a Communication within
UML is another type of diagram used to illustrate how objects in a
umlsystem interact to achieve a specific task, such as finding an object.
Unlike Sequence Diagrams, which emphasize the time order of events,
Collaboration Diagrams focus on the relationships between objects and
the flow of messages.
Identify the Objects
Similar to a Sequence Diagram, the first step is to identify the objects
involved in the interaction. For the process of finding an object, typical
objects might include:
• User: Initiates the search for an object.
• Search Service: Handles the search logic.
• Database: Stores the objects that need to be searched.
• Object: Represents the actual object being searched for.
Establish Object Relationships
Collaboration Diagrams emphasize how objects are related to each
other. In the context of finding an object, the following relationships
would exist:
•The User sends a request to the Search Service.
•The Search Service communicates with the Database to retrieve the
object.
•The Database sends the search results back to the Search Service.
•The Search Service sends the results to the User.
https://www.geeksforgeeks.org/collaboration-diagrams-unified-modeling-
languageuml/
Mapping use case to sequence
diagram
Mapping a Use Case to a Sequence Diagram
In software design, mapping a use case to a UML sequence diagram is crucial for
understanding how system components interact to accomplish a specific task. A use
case defines a user’s interaction with the system, while a sequence diagram visually
represents the flow of messages between objects or components based on the use
case scenario.
Steps for Mapping:
1. Identify Actors and System Components: Determine the key actors (users, external
systems) and components (UI, services, databases) involved.
2. Define the Flow of Events: Use the use case description to outline the sequence of
interactions.
3. Create the Sequence Diagram: Represent actors and components as lifelines and
interactions as messages with arrows, following the flow of events.
Example Use Case: Online Order Placement
Title: Place Order
Actors: Customer, Order System, Payment Service, Inventory System
Description: A customer places an order on an e-commerce platform. The
system verifies payment, updates the inventory, and confirms the order.
Main Flow:
1.Customer selects items and submits the order.
2.The order system processes the order and requests payment verification.
3.The payment service verifies the payment.
4.The order system updates the inventory.
5.The order system confirms the order to the customer.
Sequence Diagram: Explanation
Lifelines: Customer, Order System, Payment
Service, Inventory System
Interactions:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy