SlideShare a Scribd company logo
1 of 14
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
UML and OOAD
Unified Modeling Language
Object Oriented Analysis and Design
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
UML Origins
A product of the “design wars” of the 1980’s
Grady Booch, James Rumbaugh, and others had competing styles.
`94: Rumbaugh leaves GE to join Booch at Rational Software
“Method wars over. We won.” Others feared achieving
standardization the Microsoft way.
’95: Rational releases UML 0.8; Ivars Jacobson (use cases)
joins Rational“The Three Amigos”
’96: Object Management Group sets up task force on methods
’97: Rational proposed UML 1.0 to OMG. After arm twisting
and merging, UML 1.1 emerges
’99: After several years of revisions and drafts, UML 1.3 is
released
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
What UML is
• A way to express a software design, mostly through
graphical tools
• Is important for communication, does not specify the
process used to reach a design. That process is far more
more nebulous
• Compare it to using circuit schematics and timing
diagrams for documenting hardware designs
• Capture the important details, “the art is knowing what to
leave out.”
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
What UML Can Do for Us
• Lets us make out mistakes on paper, before we write and
debug the code
• Lets us communicate our ideas better
• Lets us tap into a wealth of existing designs (patterns) that
lets us draw on others’ experience
• Lets us use existing tools designed around UML
Rational Rose
Rhapsody
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
UML Tools: Class Diagram
•Captures the packaging of the solution into
software objects.
•Elaborates the relationships betweeen objects,
allowing dependencies to be controlled.
•In an OO language, leads directly to coded
objects.
•A good basis for discussion and
documentation.
•But, it only shows the static structure.
•Like a circuit diagram in electronics, it shows
connectivity but not the dynamics of signals or
messages.
Order
dateReceived
isPrepaid
number : String
prince : Money
dispatch()
close()
Customer
name
address
creditRating():String
* 1
Personal
Customer
creditCard#
Corporate
Customer
contactName
creditRating
creditLimit
remind()
billForMonth(Integer)
Order Line
quantity : Integer
price : Money
isSatisfied : Boolean
Employee
*
0..1
Product
* 1
*
1
{creditRating()==
"poor"}
sales rep
line
items
Multiplicity: mandatory
Association
Role
Name
Attributes
Operations
Generalization
(inheritance)
Class
Multiplicity: optional
Multiplicity: many-valued
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
UML Tools: Sequence Diagram
• Time runs downward
• Shows how objects interact
• Gives the sequence of interactions,
but not the precise timing
• Roughly analogous to timing
diagrams in electronics
• Have already been extremely
useful in developing the DSP
communication with the ROD
hardware
an Order Entry
window
an Order an Order Line a Stock Item
a Reorder
Item
a Delivery
Item
prepare()
* prepare()
hasStock:=
check()
hasStock:=
remove() needsReorder:=
needsToReorder()
[needsReorder]
new
[hasStock] new
Object
Message
Iteration
Condition
Self-Call
Return
Creation
Deletion
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
UML Tools: State Diagram
• Not much different from usage in
many other areas
• Describes an object that changes
state under specified transition
activities and does specified
activities in that state
• Another tool for describing dynamic
behavior
Checking
do/check
item
Dispatching
do/initiate
delivery
Waiting Delivered
[Not all items checked]
/get next item
/get first item
[All items checked &&
all items available]
Delivered
Item Received
[some items not in stock]
start
state
self-transition
transition
activity
I
t
e
m
R
e
c
e
i
v
e
d
[
a
l
l
i
t
e
m
s
a
v
a
i
l
a
b
l
e
]
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
OOAD
• Going to Object Oriented software is not just changing the
syntax of the language. It is a new way of organizing
software.
• An object is an instantiation of a class. Just as i can be an
instantiation of type integer, x an instantiation of type float
and “A” and instantiation of type char, an object myObj
can be an instantiation of a (user-defined) class myClass.
• An object has a state (specified by values of attributes) and
behavior (given by functions, or methods).
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
OOAD (2)
• The idea is to keep as many of the details of the objects
functionality inside the object and present only a well-
defined interface to the outside world.
• Open to extending the behavior or the object, but closed to
exposing changes inside the object to the outside world.
• Try to keep one piece of software from depending on
changes to another piece.
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
Example 1: VME Crate
A VME crate has three modules in it: ADC, TDC, CPU.
We need a routine that initializes the entire crate.
The old way:
Void initCrate(int crateNumber)
{
initADC();
initTDC();
initCPU();
}
There are smarter ways (e.g. case statements), but there is no way to avoid
the need for initCrate to call separate init routines for each type of module.
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
VME Crate (2)
The OO way:
Void initCrate(crateNumber)
{
// interate over modules
Module.init();
}
The routine initCrate no longer needs to know what kind of module it is
talking to. We could even add a new type of module and it wouldn’t care.
vmeModule
init()
adcModule
init()
tdcModule
init()
cpuModule
init()
vmeCrate
initCrate()
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
VME Crate (3)
• The module-specific details are encapsulated inside the
object.
• The various init routines are polymorphic as seen from the
outside world.
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
Example 2: Database Access
myDatabase
addRecord()
simpleTextDb
addRecord()
bigFancyOoDb
dbUser
storeInfo()
addRecord()
As long as the methods of dbUser refer to the interfaces of myDataBase,
they will not care whether we use a simple ASCII text file or a messy object
oriented database. We can go from one to the other without changing dbUser.
Tom Meyer, Iowa State
Meyer@iastate.edu
SCT/Pixel Online Workshop
18-19 June, 2001
References
ISBN: 020165783X ISBN: 0132038374

More Related Content

Similar to Unified Modeling Language Object Oriented Analysis and Design

Stevecook uml mdday2010
Stevecook uml mdday2010Stevecook uml mdday2010
Stevecook uml mdday2010
MD DAY
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
the_wumberlog
 
Various Approaches Of System Analysis
Various Approaches Of System AnalysisVarious Approaches Of System Analysis
Various Approaches Of System Analysis
Laura Torres
 

Similar to Unified Modeling Language Object Oriented Analysis and Design (20)

lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
The secret life of rules in Software Engineering
The secret life of rules in Software EngineeringThe secret life of rules in Software Engineering
The secret life of rules in Software Engineering
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Cloud computing slids
Cloud computing slidsCloud computing slids
Cloud computing slids
 
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
 
Uml1 concepts
Uml1 conceptsUml1 concepts
Uml1 concepts
 
MODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in PracticeMODEL-DRIVEN ENGINEERING (MDE) in Practice
MODEL-DRIVEN ENGINEERING (MDE) in Practice
 
Stevecook uml mdday2010
Stevecook uml mdday2010Stevecook uml mdday2010
Stevecook uml mdday2010
 
Unit-1 OOAD Introduction.pptx
Unit-1 OOAD Introduction.pptxUnit-1 OOAD Introduction.pptx
Unit-1 OOAD Introduction.pptx
 
Syllabus.pdf
Syllabus.pdfSyllabus.pdf
Syllabus.pdf
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
C++ Basics
C++ BasicsC++ Basics
C++ Basics
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
Day5
Day5Day5
Day5
 
System on Chip Design and Modelling Dr. David J Greaves
System on Chip Design and Modelling   Dr. David J GreavesSystem on Chip Design and Modelling   Dr. David J Greaves
System on Chip Design and Modelling Dr. David J Greaves
 
Apostila UML
Apostila UMLApostila UML
Apostila UML
 
Object Oriented Database
Object Oriented DatabaseObject Oriented Database
Object Oriented Database
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD ppt
 
Various Approaches Of System Analysis
Various Approaches Of System AnalysisVarious Approaches Of System Analysis
Various Approaches Of System Analysis
 
It110 assignment-1 answer key
It110 assignment-1 answer keyIt110 assignment-1 answer key
It110 assignment-1 answer key
 

More from saman zaker

Enterprise Unified Process and rup methodology
Enterprise Unified Process and rup methodologyEnterprise Unified Process and rup methodology
Enterprise Unified Process and rup methodology
saman zaker
 
A Live Virtual Simulator for Teaching Cybersecurity
A Live Virtual Simulator for Teaching CybersecurityA Live Virtual Simulator for Teaching Cybersecurity
A Live Virtual Simulator for Teaching Cybersecurity
saman zaker
 

More from saman zaker (14)

Enterprise Unified Process and rup methodology
Enterprise Unified Process and rup methodologyEnterprise Unified Process and rup methodology
Enterprise Unified Process and rup methodology
 
Rational: The Platform for Software Development
Rational: The Platform for Software DevelopmentRational: The Platform for Software Development
Rational: The Platform for Software Development
 
Steps for System Design Realize all Use Cases Use Sequence Diagram
Steps for System Design Realize all Use Cases Use Sequence DiagramSteps for System Design Realize all Use Cases Use Sequence Diagram
Steps for System Design Realize all Use Cases Use Sequence Diagram
 
Business Use Case Diagrams The diagrams to divide the workflow as smaller uni...
Business Use Case Diagrams The diagrams to divide the workflow as smaller uni...Business Use Case Diagrams The diagrams to divide the workflow as smaller uni...
Business Use Case Diagrams The diagrams to divide the workflow as smaller uni...
 
Dr Deepak B Phatak Subrao Nilekani Chair Professor
Dr Deepak B Phatak Subrao Nilekani Chair ProfessorDr Deepak B Phatak Subrao Nilekani Chair Professor
Dr Deepak B Phatak Subrao Nilekani Chair Professor
 
Florida International University School of Computing and Information Sciences...
Florida International UniversitySchool of Computing and Information Sciences...Florida International UniversitySchool of Computing and Information Sciences...
Florida International University School of Computing and Information Sciences...
 
Automated generation of DRM instances from models
Automated generation of DRM instances from modelsAutomated generation of DRM instances from models
Automated generation of DRM instances from models
 
Outsourcing is the movement of computer-based functions
Outsourcing is the movement of computer-based functionsOutsourcing is the movement of computer-based functions
Outsourcing is the movement of computer-based functions
 
SA Definition: An abstract view of a system
SA Definition: An abstract view of a systemSA Definition: An abstract view of a system
SA Definition: An abstract view of a system
 
the Modeling is a way of thinking about the
the Modeling is a way of thinking about thethe Modeling is a way of thinking about the
the Modeling is a way of thinking about the
 
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
Rational Rose is a Computer Aided Software Engineering (CASE) tool. It is a g...
 
Visual Modeling for Java Developers 方俊賢 Ken Fang Software Engineering Sp...
Visual Modeling for Java Developers方俊賢    Ken Fang Software Engineering Sp...Visual Modeling for Java Developers方俊賢    Ken Fang Software Engineering Sp...
Visual Modeling for Java Developers 方俊賢 Ken Fang Software Engineering Sp...
 
Acquaint you with WIM Why produce WIM in the military Describe Rational Ro...
Acquaint you with WIM  Why produce WIM in the military   Describe Rational Ro...Acquaint you with WIM  Why produce WIM in the military   Describe Rational Ro...
Acquaint you with WIM Why produce WIM in the military Describe Rational Ro...
 
A Live Virtual Simulator for Teaching Cybersecurity
A Live Virtual Simulator for Teaching CybersecurityA Live Virtual Simulator for Teaching Cybersecurity
A Live Virtual Simulator for Teaching Cybersecurity
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Unified Modeling Language Object Oriented Analysis and Design

  • 1. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 UML and OOAD Unified Modeling Language Object Oriented Analysis and Design
  • 2. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 UML Origins A product of the “design wars” of the 1980’s Grady Booch, James Rumbaugh, and others had competing styles. `94: Rumbaugh leaves GE to join Booch at Rational Software “Method wars over. We won.” Others feared achieving standardization the Microsoft way. ’95: Rational releases UML 0.8; Ivars Jacobson (use cases) joins Rational“The Three Amigos” ’96: Object Management Group sets up task force on methods ’97: Rational proposed UML 1.0 to OMG. After arm twisting and merging, UML 1.1 emerges ’99: After several years of revisions and drafts, UML 1.3 is released
  • 3. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 What UML is • A way to express a software design, mostly through graphical tools • Is important for communication, does not specify the process used to reach a design. That process is far more more nebulous • Compare it to using circuit schematics and timing diagrams for documenting hardware designs • Capture the important details, “the art is knowing what to leave out.”
  • 4. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 What UML Can Do for Us • Lets us make out mistakes on paper, before we write and debug the code • Lets us communicate our ideas better • Lets us tap into a wealth of existing designs (patterns) that lets us draw on others’ experience • Lets us use existing tools designed around UML Rational Rose Rhapsody
  • 5. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 UML Tools: Class Diagram •Captures the packaging of the solution into software objects. •Elaborates the relationships betweeen objects, allowing dependencies to be controlled. •In an OO language, leads directly to coded objects. •A good basis for discussion and documentation. •But, it only shows the static structure. •Like a circuit diagram in electronics, it shows connectivity but not the dynamics of signals or messages. Order dateReceived isPrepaid number : String prince : Money dispatch() close() Customer name address creditRating():String * 1 Personal Customer creditCard# Corporate Customer contactName creditRating creditLimit remind() billForMonth(Integer) Order Line quantity : Integer price : Money isSatisfied : Boolean Employee * 0..1 Product * 1 * 1 {creditRating()== "poor"} sales rep line items Multiplicity: mandatory Association Role Name Attributes Operations Generalization (inheritance) Class Multiplicity: optional Multiplicity: many-valued
  • 6. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 UML Tools: Sequence Diagram • Time runs downward • Shows how objects interact • Gives the sequence of interactions, but not the precise timing • Roughly analogous to timing diagrams in electronics • Have already been extremely useful in developing the DSP communication with the ROD hardware an Order Entry window an Order an Order Line a Stock Item a Reorder Item a Delivery Item prepare() * prepare() hasStock:= check() hasStock:= remove() needsReorder:= needsToReorder() [needsReorder] new [hasStock] new Object Message Iteration Condition Self-Call Return Creation Deletion
  • 7. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 UML Tools: State Diagram • Not much different from usage in many other areas • Describes an object that changes state under specified transition activities and does specified activities in that state • Another tool for describing dynamic behavior Checking do/check item Dispatching do/initiate delivery Waiting Delivered [Not all items checked] /get next item /get first item [All items checked && all items available] Delivered Item Received [some items not in stock] start state self-transition transition activity I t e m R e c e i v e d [ a l l i t e m s a v a i l a b l e ]
  • 8. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 OOAD • Going to Object Oriented software is not just changing the syntax of the language. It is a new way of organizing software. • An object is an instantiation of a class. Just as i can be an instantiation of type integer, x an instantiation of type float and “A” and instantiation of type char, an object myObj can be an instantiation of a (user-defined) class myClass. • An object has a state (specified by values of attributes) and behavior (given by functions, or methods).
  • 9. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 OOAD (2) • The idea is to keep as many of the details of the objects functionality inside the object and present only a well- defined interface to the outside world. • Open to extending the behavior or the object, but closed to exposing changes inside the object to the outside world. • Try to keep one piece of software from depending on changes to another piece.
  • 10. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 Example 1: VME Crate A VME crate has three modules in it: ADC, TDC, CPU. We need a routine that initializes the entire crate. The old way: Void initCrate(int crateNumber) { initADC(); initTDC(); initCPU(); } There are smarter ways (e.g. case statements), but there is no way to avoid the need for initCrate to call separate init routines for each type of module.
  • 11. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 VME Crate (2) The OO way: Void initCrate(crateNumber) { // interate over modules Module.init(); } The routine initCrate no longer needs to know what kind of module it is talking to. We could even add a new type of module and it wouldn’t care. vmeModule init() adcModule init() tdcModule init() cpuModule init() vmeCrate initCrate()
  • 12. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 VME Crate (3) • The module-specific details are encapsulated inside the object. • The various init routines are polymorphic as seen from the outside world.
  • 13. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 Example 2: Database Access myDatabase addRecord() simpleTextDb addRecord() bigFancyOoDb dbUser storeInfo() addRecord() As long as the methods of dbUser refer to the interfaces of myDataBase, they will not care whether we use a simple ASCII text file or a messy object oriented database. We can go from one to the other without changing dbUser.
  • 14. Tom Meyer, Iowa State Meyer@iastate.edu SCT/Pixel Online Workshop 18-19 June, 2001 References ISBN: 020165783X ISBN: 0132038374