0% found this document useful (0 votes)
80 views49 pages

Domain Modelling

This document discusses domain modeling and object-oriented analysis. It covers key concepts in domain modeling including classes, attributes, operations, relationships and multiplicity. It provides examples of class diagrams and discusses best practices for conceptual modeling, identifying classes, attributes and relationships, and verifying models. The document emphasizes an iterative process of conceptual modeling, adding more detail in each iteration and validating the model with users.

Uploaded by

JohnLuce
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)
80 views49 pages

Domain Modelling

This document discusses domain modeling and object-oriented analysis. It covers key concepts in domain modeling including classes, attributes, operations, relationships and multiplicity. It provides examples of class diagrams and discusses best practices for conceptual modeling, identifying classes, attributes and relationships, and verifying models. The document emphasizes an iterative process of conceptual modeling, adding more detail in each iteration and validating the model with users.

Uploaded by

JohnLuce
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/ 49

Domain Modelling

Dr Kristin Stock

Where are we up to?

Why is systems analysis and modelling important?

Questionnaires,
Interviews, JAD, etc.
Root Cause Analysis,
Problem Analysis, etc.

Techniques
Strategies

Mrs Smith likes to have her car


serviced once a year or every
10,000 kms, whichever is sooner,
and is very concerned that she not
leave it too long. She would like to
be reminded of the need for the
service, but does not use any
technology other than a basic
mobile phone..

Fig 4.13: Referred


to in Event 1 and 5
(Normal flow)

Fig 4.13: Event 1 and 2 (normal flow)

Fig 4.13: Event 3


(normal flow)

Fig 4.13: Event 5


(Normal flow),
Subflow S-1

Fig 4.13: Event 4


(normal flow)
Fig 4.13: Event 5
(Normal flow),
Subflow2

Fig 4.13: Event 5


(Normal flow),
Subflow S-3

What Next?
Once weve looked at use cases and business
processes, we can start to think about the objects
involved in the domain
We often begin at a conceptual level, and then
work down adding more detail.
This session:
The basics of object modelling (classes,
relationships, attributes, operations)
Conceptual level modelling (modelling the domain)
Verifying and validating.

Functional vs. Structural


Functional
models represent
system behavior
Structural models
represent system
objects and their
relationships:
People
Places
Things

What is he
doing?
vs
What are the
things hes
doing it with?

Photo 2

Photo 1

http://
q.xorro.com/pndk
Objects and
Structural Modelling

Structural Models
Drawn using an iterative process
First drawn in a conceptual, business-centric way
Then refined in a technology-centric way
describing the actual databases and files
More and more detail is added in each iteration

Create a vocabulary for analysts & users


Allows effective communication between
analysts & users

Structural Models
Main goal: to discover the key data
contained in the problem domain and to
build a structural model of the objects
Structural
Modeling

Solution Domain
Problem Domain

Conceptual Analysis and


Modelling

High level.
Sketches out broad concepts.
Can work with users to define high level concepts.
e.g. Concept Mapping.

is in
house

is in
street

city

Mary and Simon live in a Californian Bungalow at 9 Black


Street, Takapuna, Auckland. They run a business from
their home, making individual cakes for special occasions
and delivering them all over Auckland. They would like to
create a web site to advertise their cakes, allow online
payment and to collect reviews from their customers.
Draw a simple conceptual model of the objects that might
be important for their new web application.

Classes
In a class diagram, the objects in the system
(concepts in the conceptual model) are
represented as classes.
A class is a group of individual objects.
E.g. the class road, person, customer, cake.
In UML, we create class diagrams to show the
classes involved in a system, and their
interactions.

Classes and Naming


In UML class diagrams:
Each class has a unique name.
Names are singular.
We use PascalCase: e.g. MainRoad, Cake,
ChocolateCake

Identifying Classes
We can identify classes from:

Conceptual model;
Use case diagram and description (nouns);
Brainstorming;
Workshops with users (esp. data intensive
systems);
Sometimes activity diagram may identify important
classes and groups of classes.

Classes from the Real World


We create classes to model categories of objects
in the real world.
Which objects?
How much detail?
It all depends on the application. What is its
purpose?
Which objects are needed to support that
purpose.

Domain Modelling
What is a domain?
The scope/sphere within
which the model is
created.
E.g. petroleum geology;
marine science
Usually our domain
models model a subset of
these that are relevant to
the problem we are
working on.

How much detail?


There is often pressure to model everything.
it would be really good if we could.

But any objects you model may ultimately become


either database tables or software modules.
They have to be maintained.
The cost of keeping redundant information in a
system is high.
Probably wont be maintained.
Need to strike a balance.
Phased SDLC is good for this.

Classes, Attributes, & Operations


Classes
Templates for instances of people,
places, or things
Attributes
Properties that describe the state
of an instance of a class (an object)
Operations
Actions or functions that a class
can perform

Attributes
Characteristics of a class.
Often in a textual descriptions, they
are adjectives (the red car, the
chocolate cake, the fast delivery).
It is not always clear whether
something should be modelled as
an attribute or a class:
Make it a class if it has other
attributes or operations of its own,
otherwise an attribute.

camelCase, singular

Operations
Things that can be done with/to a class, or its
own inherent behaviour.
Often in a textual descriptions, they are verbs
(bake a cake, sell a cake, deliver a cake).
Again, a word of caution some verbs are not
operations, but associations between classes.

Relationships
Associations between classes.
Indicate some link or dependency.
There are many kinds of associations, usually they
can be described with a verb (has, contains, is part
of, etc).
Should be able to read through the diagram with
classes and associations.
is in
house

is in
street

city

Example

House
streetNumber
houseType
buildDate
owner
rebuild
renovate

Street
is in

streetType
oneWay
suburb

Associations
Depicted with a line labeled with the name of
the relationship
May be directional (depicted with a triangle;
e.g., a patient schedules an appointment)

Classes may be related to themselves


(e.g., employees and managers who may
be members of the same class)
Multiplicity indicates how many of one
class are related to another class

Multiplicities
Department
1

Child

Zero or more:
An employee has zero to
many children

Employee

One or more:
A boss is responsible for
one or more employees

0..*

Boss
1

Exactly one:
A department has one and
only one boss

Employee
1

Boss

1..*

Multiplicity and Cardinality


Often in data model, people refer to
cardinality (1:m; m:m; m:1).
UML instead uses multiplicity, which is similar
in meaning, but UML allows numbers to be
specified.

Example

House
streetNumber
houseType
buildDate
owner
rebuild
renovate

Street
streetType
oneWay
suburb

is in

does a house have to be in a street?


can a house be in more than one street

does a street have to contain houses?


can a street contain more than one house?
how many houses can a street contain?

Example

House
streetNumber
houseType
buildDate
owner
rebuild
renovate

Street
is in
1

0..*

streetType
oneWay
suburb

does a house have to be in a street?


can a house be in more than one street

does a street have to contain houses?


can a street contain more than one house?
how many houses can a street contain?

Example

House
streetNumber
houseType
buildDate
owner

Street
is in
0..*

streetType
oneWay
suburb

rebuild
renovate

http://q.xorro.com/pndk
multiplicity

Sample Class Diagram

Simplifying Class Diagrams


Fully populated class diagrams of real-world
system can be difficult to understand
Common ways of simplifying class diagrams:
Show only concrete classes
The view mechanism shows a subset of classes
Packages show aggregations of classes (or any
elements in UML)

Object Diagrams
Class diagrams with instantiated classes
Example: instead of a Doctor class, create an
actual doctor, say Dr. Smith
Place values into each attribute

Used to discover additional attributes,


relationships and/or operations or those
that are misplaced

Example Object Diagram

Verifying and Validating


1. Create the class diagram
2. Review the class diagramremove unnecessary classes,
attributes, operations and/or relationships
3. Incorporate patterns
4. Go back and check against all previous documents:

Functional and non-functional requirements.

Use case diagrams.

Use case descriptions.

Activity diagrams.

Verifying and Validating (contd)


5. Review and validate the model with users, walkthrough,
explain, check.
Is it ever
possible for a
house to be
in 3 streets?

Can a house
ever not be
in a street?

Find the right people


to ask.

Push to find the


boundaries now,
otherwise the system
will break when you
build it!

Iteration
The class diagram will evolve through the
analysis phase particularly.
Gradually we add more detail.

INSPIRE

INSPIRE
European Directive.
http://inspire.ec.europa.eu/
Develops standards and processes to share data
across 34 themes important for environmental
management, among 28 member states.

Protected Sites
Convened thematic experts from around
Europe.
Had workshops to identify relevant classes
and attributes.
Also several existing domain models in use
around Europe.

Summary
Structural Models
Classes, Attributes, Operations, Associations.
More detail on these next time.

Verifying and validating. Important!

You might also like