SlideShare a Scribd company logo
Object Oriented Analysis & 
1 
Design (OOAD)
2 
OOAD 
• It focuses on objects where system is broken 
down in terms of the objects that exist within it. 
• Functions (behaviour) and data (state) relating 
to a single object are self-contained or 
encapsulated in one place.
3 
Objects 
• Object is an abstraction of something in a 
problem domain, reflecting the capabilities 
of the system to keep information about it, 
interact with it, or both. 
• Objects are entities in a software system 
which represent instances of real-world and 
system entities
4 
Objects 
Object Identity Behaviors State 
An employee “Mr. John” Join(), 
Retire() 
Joined, 
Retired. 
A book “Book with title 
Object Oriented 
Analysis Design” 
AddExemplar, Rent, 
available, 
reserved 
A sale “Sale no 0015, 
15/12/98” 
SendInvoiced(), 
Cancel(). 
Invoiced, 
cancelled.
5 
Object Class 
• Class is a description of a set of objects that 
share the same attributes, operations, 
methods, relationship and semantics. 
• Object classes are templates for objects. 
They may be used to create objects. 
• An object represents a particular instance of 
a class.
6 
Term of objects 
• Attribute: data items that define object. 
• Operation: function in a class that combine 
to form behavior of class. 
• Methods: the actual implementation of 
procedure (the body of code that is executed 
in response to a request from other objects 
in the system).
Employee object & class 
7 
Class Object 
Employee 
name: string 
address: string 
dateOfBirth: Date 
employeeNo: integer 
socialSecurityNo: string 
department: Dept 
manager: Employee 
salary: integer 
status: {current, left, retired} 
taxCode: integer 
. . . 
join () 
leave () 
retire () 
changeDetails () 
Employee16 
name: John 
address: M Street No.23 
dateOfBirth: 02/10/65 
employeeNo: 324 
socialecurityNo:E342545 
department: Sale 
manager: Employee1 
salary: 2340 
stauts:current 
taxCode: 3432 
…. 
Eployee16.join(02/05/1997) 
Eployee16.retire(03/08/2005) 
Eployee16.changeDetail(“X 
Street No. 12”)
Encapsulation and Data Hiding 
• Packaging related data and operations 
together is called encapsulation. 
• Data hiding: hides the internal data from 
external by methods (interface). 
8
public methods + printNumCustomer( ): void 
9 
Encapsulation 
 private attributes and methods are encapsulated within the 
class, they cannot be seen by clients of the class 
 public methods define the interface that the class provides 
to its clients 
Customer 
- numCustomers = 0 
- MIN_BUDGET = 200 
- name: String 
- address: String 
- budget: int 
+ placeOrder( ): void 
private attributes 
Customer class
Object communication 
• Objects communicate with each other by sending 
messages 
– a message is a method call from a message-sending 
object to a message-receiving object 
– a message consists of 
• an object reference which indicates the message receiver 
• a method name (corresponding to a method of the receiver), 
and 
• parameters (corresponding to the arguments of the calling 
method) 
– a message-receiving object is a server to a message-sending 
object, and the message-sending object is a 
10 
client of the server
11 
Message Passing 
name = “Alex” 
address = 
“1 Robinson Rd” 
budget = 2000 
placeOrder( ): void 
name = “Lawrence” 
employeeNo =15 
commission = 200 
takeOrder( ): int 
message 
takeOrder(“sofa”, name, 
address, “120799”) 
199 
return value alex lawrence 
message 
lawrence.takeOrder(“sofa”, “1 Robinson Rd”, “120799”) 
object reference method name parameters
SalesPerson 
12 
Message Passing 
Customer 
- numCustomers = 0 
- MIN_BUDGET = 200 
- name: String 
- address: String 
- budget: int 
+ printNumCustomer( ): void 
+ placeOrder( ): void 
- MAX_ PRICE = 200 
- name: String 
- employeeNo: String 
- commission: int 
+ takeOrder( ): void 
alex lawrence takeOrder 
client server
13 
Inheritance 
• Object classes may inherit attributes and 
services from other object classes. 
• Inheritance represents the generalization of 
a class.
A generalisation hierarchy 
14 
Employee 
Programmer 
project 
progLanguage 
Manager 
budgetsControlled 
dateAppointed 
Project 
Manager 
projects 
Dept. 
Manager 
Strategic 
Manager 
dept responsibilities
Library class 
hierarchy 
Recorded item 
Computer 
program 
15 
Acquire () 
Catalogue () 
Dispose () 
Issue () 
Return () 
Book 
Published item 
Author 
Edition 
Publication date 
ISBN 
Magazine 
Year 
Issue 
Film 
Director 
Date of release 
Distrib 
Version 
Platform 
Title 
Publisher 
Title 
Medium 
Library Item 
Catalogue Number 
Acquisition date 
Cost 
Type 
Status 
Number of copies
User class hierarchy 
Student 
16 
Library user 
Name 
Address 
Phone 
Registration # 
Register () 
De-r egister () 
Reader 
Affiliation 
Borrower 
Items on loan 
Max. loans 
Staff 
Department 
Department phone 
Major subject 
Home address
Multiple inheritance 
• Rather than inheriting the attributes and services 
from a single parent class, a system which 
supports multiple inheritance allows object classes 
to inherit from several super-classes 
• Can lead to semantic conflicts where 
attributes/services with the same name in different 
super-classes have different semantics 
• Makes class hierarchy reorganisation more 
complex 
17
Multiple inheritance 
Voice recording 
18 
Talking book 
Author 
Edition 
Publication date 
ISBN 
# Tapes 
Book 
Speaker 
Duration 
Recording date
Advantages of inheritance 
• It is an abstraction mechanism which may 
be used to classify entities 
• It is a reuse mechanism at both the design 
and the programming level 
• The inheritance graph is a source of 
organisational knowledge about domains 
and systems 
19
Problems with inheritance 
• Object classes are not self-contained. they cannot 
be understood without reference to their super-classes 
• Designers have a tendency to reuse the inheritance 
graph created during analysis. Can lead to 
significant inefficiency 
• The inheritance graphs of analysis, design and 
implementation have different functions and 
should be separately maintained 
20
Inheritance and OOD 
• There are differing views as to whether 
inheritance is fundamental to OOD. 
– View 1. Identifying the inheritance hierarchy or 
network is a fundamental part of object-oriented design. 
Obviously this can only be implemented using an 
OOPL. 
– View 2. Inheritance is a useful implementation concept 
which allows reuse of attribute and operation 
definitions. Identifying an inheritance hierarchy at the 
design stage places unnecessary restrictions on the 
implementation 
• Inheritance introduces complexity and this is 
undesirable, especially in critical systems 
21
Objects Association 
• Modeling an association between two classes 
means that there is some sort of relationship 
between objects of each class that may be 
connected. 
Student 0..* Course 1..* 
22 
studies
Object aggregation 
• Aggregation model shows how classes 
which are collections are composed of other 
classes 
• Similar to the part-of relationship in 
semantic data models 
23
Object aggregation 
Videotape 
Tape ids. 
24 
Study pack 
Lecture 
notes 
Text 
OHP slides 
Slides 
Assignment 
Credits 
Solutions 
Text 
Diagrams 
Exercises 
#Problems 
Description 
Course title 
Number 
Year 
Instructor 
1 ..* 
1 1 1 1 
1 ..* 1 ..* 0 ..* 
1 1 
1 ..* 1 ..*
Object Cohesion & Coupling 
• Cohesion of a component is a measure of how 
well it fits together. Each operation provides 
functionality which allows the attributes of the 
object to be modified, inspected or used as a basis 
for service provision. 
• Coupling is an indication of the strength of 
interconnections between program units. Highly 
coupled systems have strong interconnections, 
with program units dependent on each other 
(shared variables, interchange control function). 
Loosely coupled system which are independent . 
25
name 
getName( ) 
calculateArea( ) 
26 
Polymorphism 
• the ability of different objects to perform the 
appropriate method in response to the same 
message is known as polymorphism. 
• the selection of the appropriate method depends 
on the class used to create the object 
Shape 
Circle Square 
side 
calculateArea( ) 
radius 
calculateArea( )
Example Polymorphism 
27 
class Shape { 
private String name; 
public Shape(String aName) { name=aName; } 
public String getName( ) { return name; } 
public float calculateArea( ) { return 0.0f; } 
} // End Shape class a generic action 
class Circle extends Shape { 
private float radius; 
public Circle(String aName) { super(aName); radius = 1.0f; } 
public Circle(String aName, float radius) { 
super(aName); this.radius = radius; 
} 
public float calculateArea() { return (float)3.14f*radius*radius; } 
} // End Circle class 
inheritance 
overloading 
overriding
28 
class Square extends Shape { 
private float side; 
public Square(String aName) { super(aName); side = 
1.0f; } 
public Square(String aName, float side) { 
super(aName); this.side = side; 
} 
public float calculateArea() { return (float) 
side*side; } 
} // End Square class
Polymorphism Example 
29 
public class ShapeDemoClient { 
public static void main(String argv[ ]) { 
Shape c1 = new Circle("Circle C1"); 
Shape c2 = new Circle("Circle C2", 3.0f); 
Shape s1 = new Square("Square S1"); 
Shape s2 = new Square("Square S2", 3.0f); 
Shape shapeArray[ ] = {c1, s1, c2, s2}; 
for (int i = 0; i < shapeArray.length; i++) { 
System.out.println("The area of " + shapeArray[i].getName( ) 
+ " is " + shapeArray[i].calculateArea( ) 
+ " sq. cm."); 
} 
} // End main 
} // End ShapeDemoClient1 class 
rule of subtype 
dynamic binding
OO Analysis and Design 
OO Analysis - examines requirements from the perspective 
of the classes and objects found in the vocabulary of the 
problem domain. In other words, the world (of the system) 
is modelled in terms of objects and classes. 
OO Design - OO decomposition and a notation for depicting 
models of the system under development. Structures are 
developed whereby sets of objects collaborate to provide 
the behaviours that satisfy the requirements of the 
problem. 
30
Object Oriented Analysis 
31 
• Analyze the domain problem 
• Describe the process systems 
• Identify the objects 
• Specify attributes 
• Defining operations 
• Inter-object Communication
32 
Identifying Object 
• Objects can be: 
– External Entity (e.g., other systems, devices, people) 
that produce or consume information to be used by 
system 
– Things (e.g., reports, displays, letters, signals) that are 
part of information domain for the problem 
– Places (e.g., book’s room) that establish the context of 
the problem and the overall function of the system. 
– Organizational units (e.g., division, group, team, 
department) that are relevant to an application, 
– Transaction (e.g., loan, take course, buy, order).
Example of candidate objects 
Just a Line management wishes to increase security, both in their building and on 
site, without antagonizing their employees. They would also like to prevent 
people who are not part of the company from using the Just a Line car park. 
It has been decide to issue identity cards to all employees, which they are 
expected to wear while on the Just a Line site. The cards records the name, 
department and number of the member of staff, and permit access to the Just a 
Line car park. 
A barrier and a card reader are placed at the entrance to the car park. The driver of 
an approaching car insert his or her numbered card in the card reader, which 
then checks that the card number is known to the Just a Line system. If the 
card is recognized, the reader sends a signal to raise the barrier and the car is 
able to enter the car park. 
At the exit, there is also a barrier, which is raised when a car wishes to leave the 
33 
car park. 
When there are no spaces in the car park a sign at the entrance display “Full” and 
is only switched off when a car leaves. 
Special visitor’s cards, which record a number and the current date, also permit 
access to the car park. Visitor’s cards may be sent out in advance, or collected 
from reception. All visitor’s cards must be returned to reception when the 
visitor leaves Just a Line.
34 
Candidate objects: 
Just a Line management security building 
site employee people company 
car park card name department 
number member of staff access barrier 
card reader entrance driver car 
system signal exit space 
sign visitor reception
Candidate objects’ rejection 
• duplicates: if two or more objects are simply different names for the 
35 
same thing. 
• irrelevant: objects which exists in the problem domain, but which are 
not intended. 
• vague: when considering words carefully it sometimes becomes clear 
that they do not have a price meaning and cannot be the basis of a 
useful in the system. 
• general: the meaning is too broad. 
• attributes: as the attribute of objects. 
• associations: actually represents the relationships between objects. 
• roles: sometimes objects referred to by the role they play in a 
particular part of the system.
Rejected Candidate objects 
Candidate objects Rejection criteria 
Just a Line, member of staff duplicates with company, 
employee respectively 
36 
management,company, 
building, site, visitor and 
reception 
irrelevant to the system 
security, people vague 
system too general 
name, department, attribute 
access association 
driver role
37 
Rest Objects 
Car park Staff Card Visitor’s card 
Employee Entrance exit 
card reader barrier Full sign 
space sensor car
Define class attributes 
38 
Car Park 
capacity 
spaces 
inc.spaces() 
dec.spaces() 
space left() 
Full sign 
on:boolean 
switch on() 
switch off() 
Barrier 
type: 
up:boolean 
raise() 
lower() 
Card Reader 
valid card nos. 
read card() 
card OK()
39 
Data Dictionary 
Barrier: type + up 
type = [“Entrance”|”Exit”] 
up = [“true”|”false”] 
raise: if the barrier is not already raised, this operation takes as 
argument an object of the barrier class and returns an object of the 
same class, with the up attribute set to “true”. If the barrier is already 
up, the operation returns the error message “barrier is already raised” 
lower: if the barrier is not already lower, this operation takes as 
argument an object of the barrier class and returns an object of the 
same class, with the up attribute set to “false”. If the barrier is already 
down, the operation returns the error message “barrier already 
lowered”.
Objects Relationship 
Car Park Car Park 
40 
Card Reader 
2 ..* 2 ..* 
Sensor 
Barrier 
1 ..* 
1 .. * 
1 
Valid cards 
Card 
1 .. * 
Visitor’s Card Staff Card
Object behaviour modelling 
• A behavioural model shows the interactions 
between objects to produce some particular 
system behaviour that is specified as a use-case 
• Sequence diagrams (or collaboration 
diagrams) in the UML are used to model 
interaction between objects 
41
Sequence Diagram for Entrance 
:User :CarPark :Sensor :CardReader :Valid card :Barrier :Full Sign 
42 
Card OK 
Full Sign off 
Car present 
Check space left 
Yes 
Card number 
Card number 
Card returned 
Raise 
Car not present 
lower 
Decrement Space 
Check space left 
Yes
OO Analysis and Design 
Object-Oriented (OO) development is very different 
from structured development: 
• Structured approach focuses on major functions 
within a system and on the data used by the 
functions. 
• OO approach focuses on the objects in a system 
and on the relationships between those objects. 
43
· Unlike functional decomposition, OO views a 
complex problem as a meaningful collection of 
objects that collaborate to achieve some higher 
level behaviour => closely mirrors how people 
view complex problems => using OO should 
make the job of developing large, complex 
systems more manageable. 
44
Object Oriented Model 
45
46 
Structured Model
47 
Comparison 
OO: 
Systems decomposed into 
collections of data objects; 
function + data in one place => 
• System components more 
independent => more resilient 
to requirements and 
maintenance changes. 
• Inheritance and polymorphism 
are possible => reuse, 
extension, and tailoring of 
software/designs is possible. 
• Closely mirrors how humans 
decompose and solve 
complex. 
Structured: 
Systems decomposed into 
functions; functions and data 
modelled separately => 
• System components are more 
dependent on each other => 
requirements and 
maintenance changes more 
difficult 
• Inheritance and polymorphism 
not possible => limited reuse 
possible. 
• System components do not 
map closely to real-world 
entities => difficult to manage 
complexity.
48 
Comparison 
OO: 
Process allows for iterative and 
incremental development => 
• Integration of programs is 
series of incremental 
prototypes. 
• Users and developers get 
important feedback 
throughout development. 
• Testing resources distributed 
more evenly. 
• If time is short, coding and 
testing can begin before the 
design is finished. 
Structured: 
Process less flexible and largely 
linear => 
• Integration of programs is ‘big 
bang’ effect. 
• Users or developers provided 
with little or no feedback; see 
system only when it has been 
completed. 
• Testing resources are 
concentrated in the 
implementation stage only. 
• Coding and testing cannot 
begin until all previous stages 
are complete.

More Related Content

What's hot

Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Ricardo Quintero
 
analysis and design with uml
analysis and design with umlanalysis and design with uml
analysis and design with umlsabin kafle
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)ppd1961
 
Lect-4: UML diagrams - Unified Modeling Language - SPM
Lect-4: UML diagrams - Unified Modeling Language - SPMLect-4: UML diagrams - Unified Modeling Language - SPM
Lect-4: UML diagrams - Unified Modeling Language - SPMMubashir Ali
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagramsAjit Nayak
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOADDang Tuan
 
unified modelling language(UML) diagrams
unified modelling language(UML) diagramsunified modelling language(UML) diagrams
unified modelling language(UML) diagramspratyashi satapathy
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Languagesurana college
 
Uml package diagram
Uml package  diagramUml package  diagram
Uml package diagramVedaraj M
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction ModelingHemant Sharma
 

What's hot (20)

Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
analysis and design with uml
analysis and design with umlanalysis and design with uml
analysis and design with uml
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)
 
Lect-4: UML diagrams - Unified Modeling Language - SPM
Lect-4: UML diagrams - Unified Modeling Language - SPMLect-4: UML diagrams - Unified Modeling Language - SPM
Lect-4: UML diagrams - Unified Modeling Language - SPM
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
 
unified modelling language(UML) diagrams
unified modelling language(UML) diagramsunified modelling language(UML) diagrams
unified modelling language(UML) diagrams
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
Case Study Uml
Case Study UmlCase Study Uml
Case Study Uml
 
Uml
UmlUml
Uml
 
Uml
UmlUml
Uml
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Uml package diagram
Uml package  diagramUml package  diagram
Uml package diagram
 
Domain Modeling
Domain ModelingDomain Modeling
Domain Modeling
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 

Viewers also liked

An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)Jubayer Al Mahmud
 
AUTOMATIC CAR PARKING SYSTEM
AUTOMATIC CAR PARKING SYSTEMAUTOMATIC CAR PARKING SYSTEM
AUTOMATIC CAR PARKING SYSTEMsowmya Sowmya
 
Sen942 automated parking structure
Sen942 automated parking structureSen942 automated parking structure
Sen942 automated parking structuredbadiani
 
Lecture 6 collaboration diagrams
Lecture 6 collaboration diagramsLecture 6 collaboration diagrams
Lecture 6 collaboration diagramsASHOK KUMAR PALAKI
 
Lecture04- Use Case Diagrams
Lecture04- Use Case DiagramsLecture04- Use Case Diagrams
Lecture04- Use Case Diagramsartgreen
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagramsAPU
 
Baocaothuctapcuoiky
BaocaothuctapcuoikyBaocaothuctapcuoiky
BaocaothuctapcuoikyTrần Nam
 
Vehicle Parking System Project
Vehicle Parking System ProjectVehicle Parking System Project
Vehicle Parking System ProjectFarooq Mian
 
Collaboration Diagram
Collaboration DiagramCollaboration Diagram
Collaboration Diagramfahad_uaar
 
smart parking system
smart parking system smart parking system
smart parking system Che Tna
 
automatic car parking system
automatic car parking systemautomatic car parking system
automatic car parking systemsowmya Sowmya
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation systemkhushi kalaria
 
State diagram railway reservation system
State diagram railway reservation systemState diagram railway reservation system
State diagram railway reservation systemmuthumeenakshim
 
Hospital Management System
Hospital Management SystemHospital Management System
Hospital Management SystemPranil Dukare
 

Viewers also liked (17)

An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)
 
AUTOMATIC CAR PARKING SYSTEM
AUTOMATIC CAR PARKING SYSTEMAUTOMATIC CAR PARKING SYSTEM
AUTOMATIC CAR PARKING SYSTEM
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 
Sen942 automated parking structure
Sen942 automated parking structureSen942 automated parking structure
Sen942 automated parking structure
 
Lecture 6 collaboration diagrams
Lecture 6 collaboration diagramsLecture 6 collaboration diagrams
Lecture 6 collaboration diagrams
 
Lecture04- Use Case Diagrams
Lecture04- Use Case DiagramsLecture04- Use Case Diagrams
Lecture04- Use Case Diagrams
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
Baocaothuctapcuoiky
BaocaothuctapcuoikyBaocaothuctapcuoiky
Baocaothuctapcuoiky
 
Vehicle Parking System Project
Vehicle Parking System ProjectVehicle Parking System Project
Vehicle Parking System Project
 
Smart Parking
Smart ParkingSmart Parking
Smart Parking
 
Collaboration Diagram
Collaboration DiagramCollaboration Diagram
Collaboration Diagram
 
Mof
MofMof
Mof
 
smart parking system
smart parking system smart parking system
smart parking system
 
automatic car parking system
automatic car parking systemautomatic car parking system
automatic car parking system
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
 
State diagram railway reservation system
State diagram railway reservation systemState diagram railway reservation system
State diagram railway reservation system
 
Hospital Management System
Hospital Management SystemHospital Management System
Hospital Management System
 

Similar to 34. uml

implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_conceptAmit Gupta
 
Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Ganapathi M
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxelsagalgao
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptxBilalHussainShah5
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsITNet
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheelsNaveenkumar Muguda
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxanguraju1
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdwrushabhsirsat
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxraghavanp4
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming CourseDennis Chang
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Getachew Ganfur
 
Modeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalModeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalRajani Bhandari
 

Similar to 34. uml (20)

implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_concept
 
Oops concept
Oops conceptOops concept
Oops concept
 
Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0
 
OODIAGRAMS (4).ppt
OODIAGRAMS (4).pptOODIAGRAMS (4).ppt
OODIAGRAMS (4).ppt
 
OODIAGRAMS.ppt
OODIAGRAMS.pptOODIAGRAMS.ppt
OODIAGRAMS.ppt
 
OODIAGRAMS.ppt
OODIAGRAMS.pptOODIAGRAMS.ppt
OODIAGRAMS.ppt
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Object & classes
Object & classes Object & classes
Object & classes
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptx
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptx
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheels
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptx
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02
 
Modeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalModeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and Functional
 

Recently uploaded

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfKamal Acharya
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxCenterEnamel
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringC Sai Kiran
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGKOUSTAV SARKAR
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxwendy cai
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...Amil baba
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Krakówbim.edu.pl
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientistgettygaming1
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdfKamal Acharya
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-IVigneshvaranMech
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationRobbie Edward Sayers
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfPipe Restoration Solutions
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf884710SadaqatAli
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxMd. Shahidul Islam Prodhan
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdfKamal Acharya
 

Recently uploaded (20)

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 

34. uml

  • 1. Object Oriented Analysis & 1 Design (OOAD)
  • 2. 2 OOAD • It focuses on objects where system is broken down in terms of the objects that exist within it. • Functions (behaviour) and data (state) relating to a single object are self-contained or encapsulated in one place.
  • 3. 3 Objects • Object is an abstraction of something in a problem domain, reflecting the capabilities of the system to keep information about it, interact with it, or both. • Objects are entities in a software system which represent instances of real-world and system entities
  • 4. 4 Objects Object Identity Behaviors State An employee “Mr. John” Join(), Retire() Joined, Retired. A book “Book with title Object Oriented Analysis Design” AddExemplar, Rent, available, reserved A sale “Sale no 0015, 15/12/98” SendInvoiced(), Cancel(). Invoiced, cancelled.
  • 5. 5 Object Class • Class is a description of a set of objects that share the same attributes, operations, methods, relationship and semantics. • Object classes are templates for objects. They may be used to create objects. • An object represents a particular instance of a class.
  • 6. 6 Term of objects • Attribute: data items that define object. • Operation: function in a class that combine to form behavior of class. • Methods: the actual implementation of procedure (the body of code that is executed in response to a request from other objects in the system).
  • 7. Employee object & class 7 Class Object Employee name: string address: string dateOfBirth: Date employeeNo: integer socialSecurityNo: string department: Dept manager: Employee salary: integer status: {current, left, retired} taxCode: integer . . . join () leave () retire () changeDetails () Employee16 name: John address: M Street No.23 dateOfBirth: 02/10/65 employeeNo: 324 socialecurityNo:E342545 department: Sale manager: Employee1 salary: 2340 stauts:current taxCode: 3432 …. Eployee16.join(02/05/1997) Eployee16.retire(03/08/2005) Eployee16.changeDetail(“X Street No. 12”)
  • 8. Encapsulation and Data Hiding • Packaging related data and operations together is called encapsulation. • Data hiding: hides the internal data from external by methods (interface). 8
  • 9. public methods + printNumCustomer( ): void 9 Encapsulation  private attributes and methods are encapsulated within the class, they cannot be seen by clients of the class  public methods define the interface that the class provides to its clients Customer - numCustomers = 0 - MIN_BUDGET = 200 - name: String - address: String - budget: int + placeOrder( ): void private attributes Customer class
  • 10. Object communication • Objects communicate with each other by sending messages – a message is a method call from a message-sending object to a message-receiving object – a message consists of • an object reference which indicates the message receiver • a method name (corresponding to a method of the receiver), and • parameters (corresponding to the arguments of the calling method) – a message-receiving object is a server to a message-sending object, and the message-sending object is a 10 client of the server
  • 11. 11 Message Passing name = “Alex” address = “1 Robinson Rd” budget = 2000 placeOrder( ): void name = “Lawrence” employeeNo =15 commission = 200 takeOrder( ): int message takeOrder(“sofa”, name, address, “120799”) 199 return value alex lawrence message lawrence.takeOrder(“sofa”, “1 Robinson Rd”, “120799”) object reference method name parameters
  • 12. SalesPerson 12 Message Passing Customer - numCustomers = 0 - MIN_BUDGET = 200 - name: String - address: String - budget: int + printNumCustomer( ): void + placeOrder( ): void - MAX_ PRICE = 200 - name: String - employeeNo: String - commission: int + takeOrder( ): void alex lawrence takeOrder client server
  • 13. 13 Inheritance • Object classes may inherit attributes and services from other object classes. • Inheritance represents the generalization of a class.
  • 14. A generalisation hierarchy 14 Employee Programmer project progLanguage Manager budgetsControlled dateAppointed Project Manager projects Dept. Manager Strategic Manager dept responsibilities
  • 15. Library class hierarchy Recorded item Computer program 15 Acquire () Catalogue () Dispose () Issue () Return () Book Published item Author Edition Publication date ISBN Magazine Year Issue Film Director Date of release Distrib Version Platform Title Publisher Title Medium Library Item Catalogue Number Acquisition date Cost Type Status Number of copies
  • 16. User class hierarchy Student 16 Library user Name Address Phone Registration # Register () De-r egister () Reader Affiliation Borrower Items on loan Max. loans Staff Department Department phone Major subject Home address
  • 17. Multiple inheritance • Rather than inheriting the attributes and services from a single parent class, a system which supports multiple inheritance allows object classes to inherit from several super-classes • Can lead to semantic conflicts where attributes/services with the same name in different super-classes have different semantics • Makes class hierarchy reorganisation more complex 17
  • 18. Multiple inheritance Voice recording 18 Talking book Author Edition Publication date ISBN # Tapes Book Speaker Duration Recording date
  • 19. Advantages of inheritance • It is an abstraction mechanism which may be used to classify entities • It is a reuse mechanism at both the design and the programming level • The inheritance graph is a source of organisational knowledge about domains and systems 19
  • 20. Problems with inheritance • Object classes are not self-contained. they cannot be understood without reference to their super-classes • Designers have a tendency to reuse the inheritance graph created during analysis. Can lead to significant inefficiency • The inheritance graphs of analysis, design and implementation have different functions and should be separately maintained 20
  • 21. Inheritance and OOD • There are differing views as to whether inheritance is fundamental to OOD. – View 1. Identifying the inheritance hierarchy or network is a fundamental part of object-oriented design. Obviously this can only be implemented using an OOPL. – View 2. Inheritance is a useful implementation concept which allows reuse of attribute and operation definitions. Identifying an inheritance hierarchy at the design stage places unnecessary restrictions on the implementation • Inheritance introduces complexity and this is undesirable, especially in critical systems 21
  • 22. Objects Association • Modeling an association between two classes means that there is some sort of relationship between objects of each class that may be connected. Student 0..* Course 1..* 22 studies
  • 23. Object aggregation • Aggregation model shows how classes which are collections are composed of other classes • Similar to the part-of relationship in semantic data models 23
  • 24. Object aggregation Videotape Tape ids. 24 Study pack Lecture notes Text OHP slides Slides Assignment Credits Solutions Text Diagrams Exercises #Problems Description Course title Number Year Instructor 1 ..* 1 1 1 1 1 ..* 1 ..* 0 ..* 1 1 1 ..* 1 ..*
  • 25. Object Cohesion & Coupling • Cohesion of a component is a measure of how well it fits together. Each operation provides functionality which allows the attributes of the object to be modified, inspected or used as a basis for service provision. • Coupling is an indication of the strength of interconnections between program units. Highly coupled systems have strong interconnections, with program units dependent on each other (shared variables, interchange control function). Loosely coupled system which are independent . 25
  • 26. name getName( ) calculateArea( ) 26 Polymorphism • the ability of different objects to perform the appropriate method in response to the same message is known as polymorphism. • the selection of the appropriate method depends on the class used to create the object Shape Circle Square side calculateArea( ) radius calculateArea( )
  • 27. Example Polymorphism 27 class Shape { private String name; public Shape(String aName) { name=aName; } public String getName( ) { return name; } public float calculateArea( ) { return 0.0f; } } // End Shape class a generic action class Circle extends Shape { private float radius; public Circle(String aName) { super(aName); radius = 1.0f; } public Circle(String aName, float radius) { super(aName); this.radius = radius; } public float calculateArea() { return (float)3.14f*radius*radius; } } // End Circle class inheritance overloading overriding
  • 28. 28 class Square extends Shape { private float side; public Square(String aName) { super(aName); side = 1.0f; } public Square(String aName, float side) { super(aName); this.side = side; } public float calculateArea() { return (float) side*side; } } // End Square class
  • 29. Polymorphism Example 29 public class ShapeDemoClient { public static void main(String argv[ ]) { Shape c1 = new Circle("Circle C1"); Shape c2 = new Circle("Circle C2", 3.0f); Shape s1 = new Square("Square S1"); Shape s2 = new Square("Square S2", 3.0f); Shape shapeArray[ ] = {c1, s1, c2, s2}; for (int i = 0; i < shapeArray.length; i++) { System.out.println("The area of " + shapeArray[i].getName( ) + " is " + shapeArray[i].calculateArea( ) + " sq. cm."); } } // End main } // End ShapeDemoClient1 class rule of subtype dynamic binding
  • 30. OO Analysis and Design OO Analysis - examines requirements from the perspective of the classes and objects found in the vocabulary of the problem domain. In other words, the world (of the system) is modelled in terms of objects and classes. OO Design - OO decomposition and a notation for depicting models of the system under development. Structures are developed whereby sets of objects collaborate to provide the behaviours that satisfy the requirements of the problem. 30
  • 31. Object Oriented Analysis 31 • Analyze the domain problem • Describe the process systems • Identify the objects • Specify attributes • Defining operations • Inter-object Communication
  • 32. 32 Identifying Object • Objects can be: – External Entity (e.g., other systems, devices, people) that produce or consume information to be used by system – Things (e.g., reports, displays, letters, signals) that are part of information domain for the problem – Places (e.g., book’s room) that establish the context of the problem and the overall function of the system. – Organizational units (e.g., division, group, team, department) that are relevant to an application, – Transaction (e.g., loan, take course, buy, order).
  • 33. Example of candidate objects Just a Line management wishes to increase security, both in their building and on site, without antagonizing their employees. They would also like to prevent people who are not part of the company from using the Just a Line car park. It has been decide to issue identity cards to all employees, which they are expected to wear while on the Just a Line site. The cards records the name, department and number of the member of staff, and permit access to the Just a Line car park. A barrier and a card reader are placed at the entrance to the car park. The driver of an approaching car insert his or her numbered card in the card reader, which then checks that the card number is known to the Just a Line system. If the card is recognized, the reader sends a signal to raise the barrier and the car is able to enter the car park. At the exit, there is also a barrier, which is raised when a car wishes to leave the 33 car park. When there are no spaces in the car park a sign at the entrance display “Full” and is only switched off when a car leaves. Special visitor’s cards, which record a number and the current date, also permit access to the car park. Visitor’s cards may be sent out in advance, or collected from reception. All visitor’s cards must be returned to reception when the visitor leaves Just a Line.
  • 34. 34 Candidate objects: Just a Line management security building site employee people company car park card name department number member of staff access barrier card reader entrance driver car system signal exit space sign visitor reception
  • 35. Candidate objects’ rejection • duplicates: if two or more objects are simply different names for the 35 same thing. • irrelevant: objects which exists in the problem domain, but which are not intended. • vague: when considering words carefully it sometimes becomes clear that they do not have a price meaning and cannot be the basis of a useful in the system. • general: the meaning is too broad. • attributes: as the attribute of objects. • associations: actually represents the relationships between objects. • roles: sometimes objects referred to by the role they play in a particular part of the system.
  • 36. Rejected Candidate objects Candidate objects Rejection criteria Just a Line, member of staff duplicates with company, employee respectively 36 management,company, building, site, visitor and reception irrelevant to the system security, people vague system too general name, department, attribute access association driver role
  • 37. 37 Rest Objects Car park Staff Card Visitor’s card Employee Entrance exit card reader barrier Full sign space sensor car
  • 38. Define class attributes 38 Car Park capacity spaces inc.spaces() dec.spaces() space left() Full sign on:boolean switch on() switch off() Barrier type: up:boolean raise() lower() Card Reader valid card nos. read card() card OK()
  • 39. 39 Data Dictionary Barrier: type + up type = [“Entrance”|”Exit”] up = [“true”|”false”] raise: if the barrier is not already raised, this operation takes as argument an object of the barrier class and returns an object of the same class, with the up attribute set to “true”. If the barrier is already up, the operation returns the error message “barrier is already raised” lower: if the barrier is not already lower, this operation takes as argument an object of the barrier class and returns an object of the same class, with the up attribute set to “false”. If the barrier is already down, the operation returns the error message “barrier already lowered”.
  • 40. Objects Relationship Car Park Car Park 40 Card Reader 2 ..* 2 ..* Sensor Barrier 1 ..* 1 .. * 1 Valid cards Card 1 .. * Visitor’s Card Staff Card
  • 41. Object behaviour modelling • A behavioural model shows the interactions between objects to produce some particular system behaviour that is specified as a use-case • Sequence diagrams (or collaboration diagrams) in the UML are used to model interaction between objects 41
  • 42. Sequence Diagram for Entrance :User :CarPark :Sensor :CardReader :Valid card :Barrier :Full Sign 42 Card OK Full Sign off Car present Check space left Yes Card number Card number Card returned Raise Car not present lower Decrement Space Check space left Yes
  • 43. OO Analysis and Design Object-Oriented (OO) development is very different from structured development: • Structured approach focuses on major functions within a system and on the data used by the functions. • OO approach focuses on the objects in a system and on the relationships between those objects. 43
  • 44. · Unlike functional decomposition, OO views a complex problem as a meaningful collection of objects that collaborate to achieve some higher level behaviour => closely mirrors how people view complex problems => using OO should make the job of developing large, complex systems more manageable. 44
  • 47. 47 Comparison OO: Systems decomposed into collections of data objects; function + data in one place => • System components more independent => more resilient to requirements and maintenance changes. • Inheritance and polymorphism are possible => reuse, extension, and tailoring of software/designs is possible. • Closely mirrors how humans decompose and solve complex. Structured: Systems decomposed into functions; functions and data modelled separately => • System components are more dependent on each other => requirements and maintenance changes more difficult • Inheritance and polymorphism not possible => limited reuse possible. • System components do not map closely to real-world entities => difficult to manage complexity.
  • 48. 48 Comparison OO: Process allows for iterative and incremental development => • Integration of programs is series of incremental prototypes. • Users and developers get important feedback throughout development. • Testing resources distributed more evenly. • If time is short, coding and testing can begin before the design is finished. Structured: Process less flexible and largely linear => • Integration of programs is ‘big bang’ effect. • Users or developers provided with little or no feedback; see system only when it has been completed. • Testing resources are concentrated in the implementation stage only. • Coding and testing cannot begin until all previous stages are complete.