Professional Documents
Culture Documents
(COMP1429)
Dr A.Kyriakidou
Object oriented Design
• Focus is on understanding the solution
• How the system does it
• Physical: aspects of the system that are dependent on the
implementation platform which will be used
• Elaborates the analysis models/diagrams to design models in order to
implement the requirements.
Incremental:
More frequent checks on how the parts fit together. Confidence that
the project is on the right track.
Goal is to complete a part of the product, but it also allows you to
foresee additional capability, discover errors or extra needs/functions in
the next increment.
Minimizes the amount of work needed for testing and monitoring.
Diagrams more enriched with information
more easily can be turned into code
maintenance is easier.
Object Oriented Object/Class modelling
process
• Identifying objects:
using encapsulation concepts, CRC cards, etc.
Dr A.Kyriakidou
• Object: a “thing” that is capable of being seen, touched or
sensed and about which users store data and associate
behaviour.
But what is an Object?
BUT WHAT IS A THING?
• Types of objects may include a person, place, tangible things or
event:
Dr A.Kyriakidou
Place objects: warehouse, building, room
Things objects: product, vehicle, equipment
Event objects: Order, payment, invoice, reservation, registration,
application, contract
•You wouldn’t say the saving, the printing, those are verbs
behaviours of objects
Classes
recap
Objects and classes go hand in hand.
Cannot talk about one without talking about the other
OOAD is all about classes because we use classes to create objects
•A good class captures one and only one abstraction . It should have
one major theme
• E.g. represents a kind of person, place, event or thing about which
the system will need to capture and store information.
Use to make
Dr A.Kyriakidou
The concept of dog The concept and some dogs
Dog Rover
Dog Colley
Patch
Name Name Sebastian
Breed Breed Dusk
Run Conker
Run
Fetch
Fetch
The problem with modeling specific instances of a class, and thus individual
objects is that it gets very complex very quickly. And that’s why we model
classes
UML notation: Class Object – Instance of Book
Class getQuantity()
Book get_bookDetails() Object – Instance of Book
set_bookDetails() Book : MariaBook
title: String deletebook()
author : String title = “Computer Science”
isbn: String author = “Sommervile”
publisher: String isbn = “6-5344-534343-4”
price: Real publisher = “Publishing”
getQuantity() price = 35.00
get_bookDetails() getQuantity()
set_bookDetails() get_bookDetails()
deletebook() set_bookDetails()
deletebook()
3 00
£
own
00
Dr A.Kyriakidou
3
ӣ
r
wn
r. B
r o
B n”
to M
r. w
M Bro
ill “ M r .
B o
me
t
So ld
een
d
Sen
’veB
u
“Yo
With encapsulation and information hiding, the overhead during maintenance is reduced as youYolk are
certain that when you are fixing a problem inside a class, only that particular class’s code is affected.
Polymorphism
•general characteristics of a class can be inherited but overridden if
need be.
• Allowing operations of different object classes to have the same
name, whilst the details of the actual operation carried out may be
different.
• E.g. “Close method” a door can “swing shut” a window can “slide
downwards”
PRINT
30000
25000 BLUE SKY A
GRAPH object
20000 I R L I N E S Sales
Report January
15000
10000
5000 BLUE SKY A
I R L I N E S Sales
0
Report February
Dr A.Kyriakidou
North South East West
• A model should:
• use a standard notation (we’ll use UML notation)
• be understandable by clients and users
• lead software engineers to have insights about the
system
• provide abstraction
OO Approach: Unified Modelling
Language (UML) models
• UML provides a rich, standardised diagrammatic notation
- For developing a series of system models
• Analysis:
• Use-case models - use case diagrams
• Conceptual object model - class diagram
• Design:
• Dynamic models
• Object sequence diagrams
• State transition diagrams
• Design class diagram
UML Models
Use Case Model: Use case diagram
•Drives the analysis - Identifies and describes the system’s functions from
the perspective of the external user, using a tool called use-cases.
Dr A.Kyriakidou
system - not any design detail.
• Identifies Classes:
• Names
Dr A.Kyriakidou
• Attributes
• Visibility
• Obvious behaviour (methods)
Dynamic Models:
Dr A.Kyriakidou
ties together the use case and the class diagrams.
Here the interaction between the classes is discussed (what
messages are being passed and what methods are initiated).
• In reality:
• An iterative process
Dr A.Kyriakidou
• Needs Experience
An OO simple process Implementation code:
code classes, their attribute
variables, methods and
visibility variables, UI,
storage etc..
Class Pseudocode
Pseudocode:
Pseudocode classes, their
Design class diagrams: attribute variables, methods
Design classes, their Class definition
and visibility variables and
attributes, operations and method logic
visibility associations
Conceptual class
Start diagrams: Interaction logic/ sequence
Business classes, their
attributes and
associations
Feed operations to classes
Requirements
Sequence Diagrams:
Start Use Case Diagrams: Scenatios, interactions
External classes Explode Use between objects, State Chart Diagrams:
(Actors),external cases messages :events, States, transitions
interactions (Use Cases) operations, creation, (ebent/action) for each
destruction class
Summary: Key concepts of object orientation
• Direct focus on managing scale and complexity and support for reuse
(abstraction, information hiding, encapsulation, inheritance etc.)
Dr A.Kyriakidou
• Should decide which approach (OOAD or SSAD) to use based
on the type of system to be built, environment etc.
.
Conclusion…
Remember:
• Despite the advances in information technologies such as
expert systems etc. or the advances in the development
approaches, still the most important asset of an organization
is its manpower, its people, having great and skilled
designers.
Dr A.Kyriakidou
next lectures.
Next week:
Using UML notations to create use case diagrams
Online quiz
• Please access the link below to leave your replies
PollEv.com/josephosunde966
Readings for this week’s lecture
Readings on object oriented analysis and UML
Sommerville (2016) – Chapters on Object Orientation and UML
Or