Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
76 views26 pages

Mirpur University of Science and Technology: Department of Software Engineering

The document discusses conceptual classes, associations, and attributes in domain modeling. It covers identifying conceptual classes from requirements and use cases by looking for nouns. Associations represent relationships between classes and have multiplicity. Attributes are data values of classes. The document warns against misrepresenting something as an attribute that should be its own class. It provides examples of a partial point-of-sale domain model with classes, associations, attributes, and discusses that domain models capture essential abstractions rather than being a single correct model.

Uploaded by

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

Mirpur University of Science and Technology: Department of Software Engineering

The document discusses conceptual classes, associations, and attributes in domain modeling. It covers identifying conceptual classes from requirements and use cases by looking for nouns. Associations represent relationships between classes and have multiplicity. Attributes are data values of classes. The document warns against misrepresenting something as an attribute that should be its own class. It provides examples of a partial point-of-sale domain model with classes, associations, attributes, and discusses that domain models capture essential abstractions rather than being a single correct model.

Uploaded by

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

MIRPUR UNIVERSITY OF SCIENCE AND TECHNOLOGY

DEPARTMENT OF SOFTWARE ENGINEERING


Software Design & Architecture
(Lecture # 8)
Conceptual Classes, Associations and Attributes in Domain Model

Samiullah Khan / Saba Zafar


(Lecturer)

Date: 16 July, 2020


LECTURE CONTENTS

1. Conceptual Classes in Domain Model

2. Associations in Domain Model

3. Multiplicity in Domain Model

4. Adding Attributes to Domain Model

5. Domain Model vs Design Model

Software Design & Architecture 3


DOMAIN MODELS:
HOW TO IDENTIFY CONCEPTUAL CLASSES ?

• Searching the Requirements


• Searching the Use Case
• Using a Concept Category List

Software Design & Architecture 4


SEARCHING THE REQUIREMENTS

• Recall that objects are nouns

• Most functions have a verb with a noun

• For example
• Record the Sale (Object Sale)

• Reduce Inventory Quantity (Object  Inventory)

Software Design & Architecture 5


SEARCHING THE REQUIREMENTS

• Watch out for adjectives


• Adjectives are attributes of objects i.e. red, sweet, technical, difficult, simple etc
• For example
• Calculate the current sale total (total is not an object)
• Cashier must log in with ID (ID is not an object)
• Display price of item (price is not an object)
• Customer selects the car and price (price is not an object)

Software Design & Architecture 6


SEARCHING THE USE CASE

• Again recall that objects are nouns


• Most sentences have a subject, verb, and object.
• For example
• Customer arrives at POS (Objects  Customer & POS)
• Customer gives a cash payment (Objects  Customer & Payment)
• Known as Noun Phrase Identification.

Software Design & Architecture 7


NOUN PHRASE IDENTIFICATION

• The fully addressed Use Cases


are an excellent description to
draw for this analysis
• Some of these noun phrases
are candidate concepts; some
may be attributes of concepts
• A mechanical noun-to-concept
mapping is not possible, as
words in a natural language
are (sometimes) ambiguous

Software Design & Architecture 8


USING A CONCEPT CATEGORY LIST
• This is one of the best ways to identify objects.
• Already provided list of concepts

Software Design & Architecture 9


DELIVERABLE

• After identifying concepts, we get an initial artifact known as Partial Domain


Model.

• Later, refinements are made to this partial domain model by showing attributes
and associations, hence forming a Conceptual Model.

Software Design & Architecture 10


POS PARTIAL DOMAIN MODEL

Software Design & Architecture 11


ASSOCIATIONS IN DOMAIN MODEL
• An association is a relationship between concepts that indicates
some meaningful and interesting connection
• The domain model is not a data model; associations are added to
highlight our rough understanding of noteworthy relationships, not
to document object or data structures.

Software Design & Architecture 12


MULTIPLICITY

• Multiplicity defines how many instances of a type A can be associated with one
instance of a type B, at a particular moment in time.
• For example, a single instance of a Store can be associated with “many” (zero or
more) Item instances.

Software Design & Architecture 13


POSSIBLE MULTIPLICITIES

Software Design & Architecture 14


DOMAIN MODEL – NAMED ASSOCIATION

• 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 15


EXAMPLE

Software Design & Architecture 16


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 17


HOW TO SELECT ATTRIBUTES

• Keep attributes simple


• Attributes in a Domain Model should preferably be:
• Pure data values: Boolean, Date, Number, String, …
• Simple attributes: Color, phone number, zip code, universal product code (UPC), ...

Software Design & Architecture 18


EXAMPLE

Software Design & Architecture 19


A COMMON MISTAKE WITH ATTRIBUTES
VS CLASSES
• The most common mistake when creating a domain model is to represent
something as an attribute when it should have been a conceptual class
• As an example, should store be an attribute of Sale, or a separate conceptual class
Store?
• In the real world, a store is not considered a number or text, the term suggests a
legal entity, an organization, and something that occupies space.

Software Design & Architecture 20


A COMMON MISTAKE WITH ATTRIBUTES
VS CLASSES
• Consider the domain of airline reservations
• Should destination be an attribute of Flight, or a separate conceptual class
Airport?
• In the real world, a destination airport is not considered a number or text, it is a
massive thing that occupies space

Software Design & Architecture 21


DOMAIN MODEL WITH ATT. & ASSOC.

Software Design & Architecture 22


DOMAIN MODEL VS DESIGN MODEL

Software Design & Architecture 23


IS THE DOMAIN MODEL CORRECT ?

• There is no such thing as a single correct domain model


• All models are approximations of the domain we are attempting to understand
• The domain model is primarily a tool of understanding and communication
among a particular group
• A useful domain model captures the essential abstractions and information
required to understand the domain in the context of the current requirements
• It aids people in understanding the domain, its concepts, terminology, and
relationships

Software Design & Architecture 24


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 25


THANKS

You might also like