Mirpur University of Science and Technology: Department of Software Engineering

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

MIRPUR UNIVERSITY OF SCIENCE AND TECHNOLOGY

DEPARTMENT OF SOFTWARE ENGINEERING


Software Design & Architecture
(Lecture # 7)

Domain Modeling

Samiullah Khan / Saba Zafar


(Lecturer)

Date: April 28, 2020


LECTURE CONTENTS

1. Short Example of Design

2. Domain Model

3. Adding Attributes in Domain Model

Software Design & Architecture 3


A SHORT EXAMPLE OF DESIGN

Dice game"
• This software simulates a player rolling two dice.
• If the total is seven, they win; otherwise, they lose.
i. Define Use Cases
ii. Define a Domain Model
iii. Assign Object Responsibilities and Draw Interaction Diagrams
iv. Define Design Class Diagrams

Software Design & Architecture 4


A SHORT EXAMPLE OF DESIGN

i. Define Use Cases


• Requirements analysis may include stories or scenarios of how people use the
application
• Use cases are not an object-oriented artifact, they are simply written stories
• For example, here is a brief version of the Play a Dice Game use case:
• Play a Dice Game: Player requests to roll the dice. System presents
results: If the dice face value totals seven, player wins; otherwise, player
loses.

Software Design & Architecture 5


A SHORT EXAMPLE OF DESIGN

ii. Define a Domain Model


• Object-oriented analysis is concerned with creating a description of the domain
from the perspective of objects
• There is an identification of the concepts, attributes, and associations that are
considered noteworthy
• The result can be expressed in a domain model that shows the noteworthy domain
concepts or objects
• For example, a partial domain model is shown in Figure.

Software Design & Architecture 6


A SHORT EXAMPLE OF DESIGN

iii. Assign Object Responsibilities and Draw Interaction Diagrams


• Object-oriented design is concerned with defining:
a. Software objects
b. Their responsibilities and collaborations
• A common notation to illustrate these collaborations is the sequence diagram
• It shows the flow of messages between software objects, and thus the
invocation of methods.
• For example, the sequence diagram in Figure illustrates an OO software
design, by sending messages to instances of the DiceGame and Die classes

Software Design & Architecture 7


ASSIGN OBJECT RESPONSIBILITIES AND
DRAW INTERACTION DIAGRAMS

• Assign Object Responsibilities and Draw Interaction Diagrams

Software Design & Architecture 8


ASSIGN OBJECT RESPONSIBILITIES AND
DRAW INTERACTION DIAGRAMS
• iv. Define Design Class Diagrams

• A static view of the class definitions is usefully shown with a


design class diagram
• This illustrates the attributes and methods of the classes
• For example, in the dice game, an inspection of the sequence
diagram leads to the partial design class diagram shown in
Figure on next slide
• Since a play message is sent to a DiceGame object, the
DiceGame class requires a play method, while class Die
requires a roll and getFaceValue method

Software Design & Architecture 9


ASSIGN OBJECT RESPONSIBILITIES AND DRAW
INTERACTION DIAGRAMS

• iv. Define Design Class Diagrams

Software Design & Architecture 10


DOMAIN MODEL

• The essential object-oriented analysis step is the decomposition of a domain into


noteworthy concepts or objects
• A domain model is a visual representation of conceptual classes or real-situation objects
in a domain
• Domain models have also been called conceptual models, domain object models, and
analysis object models
• A Domain Model illustrates meaningful concepts in a problem domain.
• It should show:
i. Concepts
ii. Associations between concepts
iii. Attributes of concepts
• Domain model is an analysis artifact and is a conceptual perspective

Software Design & Architecture 11


DOMAIN MODEL

• It focuses on explaining 'things' and products important to a business domain


• That is, a Domain Model focuses on one domain, such as POS related thing
• It also shows an abstraction of the conceptual classes
• It's easy to understand the terms and especially their relationships in a visual
language, since our brains are good at understanding visual elements
• Therefore, the domain model is a visual dictionary of the noteworthy abstractions,
domain vocabulary, and information content of the domain.

Software Design & Architecture 12


DOMAIN MODEL

• A Domain Model is a description of things in the real world


• A Domain Model is a concept is an idea, thing, or object
• It can act as a source of inspiration for designing some software objects
• It will be an input to several artifacts explored in the case studies
• The related use case concepts and insight of experts will be input to its creation

Software Design & Architecture 13


DOMAIN MODEL – NAMED ASSOCIATIONS

• Associations among the concepts can be named depending on the relationship


between two concepts
• Avoid using simple association names such as "Has" or "Uses“
• For naming an association, a verb phrase should be constructed with hyphens (-)
• The default direction to read an association name is left to right, or top to bottom.

Software Design & Architecture 14


ADDING ATTRIBUTES TO DOMAIN MODEL

• An attribute is a logical data value of an object


• Identify those attributes of conceptual classes that are needed to satisfy the
information requirements For example, a Sales receipt normally includes a date
and time.
• The Sale concept would need a date and time attribute.

Software Design & Architecture 15


CONCEPTUAL CLASSES IN SALE DOMAIN

• A central distinction between object oriented and structured analysis:


• Division by concepts (objects) rather than division by functions
• Partial domain model drawn with UML class diagram notation.

Software Design & Architecture 16


REFERENCES

• Software Engineering: A Practitioner’s Approach, Roger S. Pressman,


Bruce R. Maxim, 8th Ed, McGraw-Hill Education, 2015.
• Object-Oriented Analysis, Design and Implementation, Brahma
Dathan, Sarnath Ramnath, 2nd Ed, Universities Press, 2014

Software Design & Architecture 17


THANKS

You might also like