Software Engineering-
CS2223
Lecture 7– Domain Model
Asia Shahab
Outline
Domain Model
How to develop Domain Model
Features of Domain Model
Example of Domain Model
Case Study: Local Hospital Problem
What is a Domain Model?
Illustrates noteworthy concepts in a domain. That
is, defines what the system is about
Models the things in your system and the way
they relate to each other
A domain model is conceptual, not a software
artifact
A visual dictionary
What is a Domain Model?
Structural model of basic domain concepts and
their relationships
It may show:
domain objects or conceptual classes
associations between conceptual classes
attributes
Also called conceptual models, domain object
models, and analysis object models.
Identify Classes
The noun technique is a more mechanical approach
to identifying classes, but it is also a powerful
technique.
The basic idea is to identify all the nouns, which are
always some type of “thing,” and build the list of all
these nouns.
Then refine the list to remove duplicates and identify
which are classes and which are attributes of classes.
Here are the steps to follow when using the noun
technique:
Using the use cases, actors, and other information
about the system—including inputs and outputs—
identify all nouns.
Noun Phrases
Identifications
Consider the following problem description,
analyzed for Subjects, Verbs, Objects:
The ATM verifies whether the customer's card
number and PIN are correct.
Ifit is, then the customer can check the account
balance, deposit cash, and withdraw cash.
Customer is checking the balance simply displays
the account balance.
The ATM prints the customer’s account balance on
a receipt.
6
Noun Phrases
Analyze each subject and object as follows:
Does it represent a person performing an action?
Then it’s an actor, ‘R’.
Is it also a verb (such as ‘deposit’)? Then it may
be a method, ‘M’.
Is it a simple value, such as ‘color’ (string) or
‘money’ (number)? Then it is probably an
attribute, ‘A’.
Which NPs are unmarked? Make it ‘C’ for class.
Verbs can also be classes, for example:
Deposit is a class if it holds state information
7
Domain Model, visually
8
How to develop Domain
Model?
Identify conceptual classes
Draw them as in a UML domain model
Add associations necessary to record
relationship
Add the attributes necessary to fulfill the
information requirements
Features of a domain
model
Domain classes attributes
Associations
Multiplicity
Aggregation
Composition
Generalization
Roles
Domain Model
Each domain class denotes a type of object
Consider a use case description
Attributes
Attributes refer to properties that define the
class.
For Example
A class Client will have attributes name and
id.
Client
name: string
id: int
Class Visibility
Public +
Private -
Protected #
Circle
- centreX:Int
+ centreY:Int=0
Association
• A link between two classes
A Person works for a Company.
Association
Person Company
works for
Association Name
Multiplicity
• Describes how many instances of one concept can
be associated with one instance of the related
concept.
Multiplicity
A Student can take up to five Courses.
Student has to be enrolled in at least one
course.
Up to 300 students can enroll in a course.
A class should have at least 10 students.
Student Course
10..300 takes 1..5
Aggregation
“Has a”
A special form of association that models a
whole-part relationship
Weak association
Part
Whole
Class Student
Aggregation
Composition
“Own a”
A strong form of aggregation where components cannot
exist without the aggregate.
The parts cannot survive the whole/aggregate
Whole Part
House Room
Composition
Inheritance
Button
CancelButton AddButton
The children classes inherit the attributes of the
parent class.
Eliminating redundancy.
Generalize/specialize
Role
Each end of an association is called a
role.
Roles may have:
Name
multiplicity expression
Navigability
Case Study: Local Hospital
Problem
A Local Hospital consists of many wards, each of
which is assigned many patients. Each patient is
assigned to one doctor, who has overall
responsibility for the patients in his or her care.
Each patient is prescribed drugs by the doctor
responsible for that patient. Each nurse is assigned
to a ward and nurses all the patients in the ward.
Each patient is assigned one nurse in this position
of responsibility. Prospective ward is look-after by
the prospective doctors.
Case Study: Local Hospital Problem
Diagram: Local Hospital Problem LHP
Domain Model Practice
Actor: Instructor
Precondition: None
Flow of events: Basic Path
The instructor has selected create marking scheme.
The system prompts the instructor to enter the course name and the semester that
the course will be offered.
The instructor enters the information.
The system then prompts the instructor to add a work item name, its maximum
score, and its weight.
The instructor provides the information.
The system prompts the instructor to continue adding work items.
If the instructor agrees, step 4 is started again.
The instructor is then prompted for the late submission policy.
The instructor enters the policy.
The system saves the marking scheme and the use case ends.
Post-condition: A marking scheme has been created for a
course in the specified semester.