Overview
What is an Object?
A self-contained package, with specific variables (attributes) and methods (behaviors). An object stands alone. An objects implementation is purposely hidden from us.
CIS 554
What is an Object?
CIS 554
What is an Object?
What is a Class?
A class is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.
CIS 554
What is a Class?
Class is an implementation of an abstract data type and so encapsulates both data and operations. Object is run-time instance of class. Classes just sit there, objects do the real work. Memory is allocated for Objects not for Classes.
CIS 554
What is a Message?
The object to which the message is addressed (YourBicycle) The name of the method to perform (changeGears) Any parameters needed by the method (lowerGear)
CIS 554
Example Object
Description - provides time of day, and an audible indication of a user-defined time during the day Interface
Attributes Behaviors
Inputs - time of day, alarm time Outputs - time of day, audible alarm
hour hand, minute hand, second hand, bell Increment hour, increment minute, increment second, sound bell
CIS 554
Polymorphism
Re-useable
CIS 554
Clock Object
How does our clock rate as an object?
Encapsulation
Provides hour, minutes and seconds, and an alarm. Do we know the mechanisms for incrementing hours, minutes and seconds? Sounding the alarm?
Inheritance
We can use our simple clock object to create additional, more complex objects requiring time. E.g., chronograph, washing machine timer controller, etc.
Polymorphism
Not applicable
Re-usable
Our clock can be used in thousands of applications as is. We can use it in any application that requires us to keep track of time, and alert us when a certain time has occurred.
CIS 554
10
What is OOAD?
Object Oriented Analysis & Design is the art of developing systems based on a set of cooperating objects.
This stuff is not an exact science. Anyone who tells you that is mistaken. Experience allows you to develop the craft, but it can never be mastered. Success depends upon systems analysis and software development teams understanding OOAD and available tools. Smooth and natural transition occurs between analysis and design teams due to nature of defined processes.
CIS 554
11
What is OOAD?
OOAD facilitates a variety of processes for analyzing and developing systems.
A methodology. There is no right or wrong process to implement OOAD. Understanding the principles of OOAD, as well as the toolkits available, allows you to define or tailor your own process. The main advantage of OOAD is its integration of systems analysis and software development teams through process definition and modeling techniques available.
CIS 554
12
Visual Modeling
Modeling captures essential parts of the system. Visual modeling is modeling using standard graphical notations Dr. James Rumbaugh A picture is worth a thousand words. Ancient Proverb
Order
Business Process
Item
CIS 554
Ship via
13
What is UML?
UML stands for Unified Modeling Language The UML combines the best of the best from
Data Modeling concepts (Entity Relationship Diagrams) Business Modeling (work flow) Object Modeling Component Modeling
The UML is the standard language for visualizing, specifying, constructing, and documenting the artifacts of a softwareintensive system. It can be used with all processes, throughout the development life cycle, and across different implementation technologies
CIS 554
14
What is UML?
The Unified Modeling Language is used to Specify, Visualize, Implement, Test and Document systems. UML captures the elements and artifacts of the development of object oriented systems and software. UML also facilitates the Specification and Visualization of ANY system (whether it appear as an object-oriented system or not). It is a visual modeling tool used to implement a process and methodology.
CIS 554
15
Proprietary
UML is free to use and distribute. Third party vendors can build a tool based upon it without prior permission. Companies can use it in their design documentation without prior permission.
CIS 554
16
Static Modeling
This defines the non-changing characteristics of the system. For example:
What are the uses of the system? What are the relationships between uses in the system? What are the inputs and outputs, or interface to the system? What are the objects in the system and their relationships? How is the system deployed?
CIS 554 17
Dynamic Modeling
This defines the changing characteristics of the system. For example:
What are the various timing aspects of the uses of the system? What are the states, and circumstances of those states, that the objects in the system can be in at any particular time? How does the system behave over time as a result of the environment in which it is in?
CIS 554 18
Object
CIS 554
19
Package
Depicts relationships and dependencies of high-level components in the system.
Component
Depicts relationships and dependencies of system components.
Deployment
Depicts how system components are implemented in hardware in the system.
CIS 554
20
Bank System
*
* * Bank Member * * **
Deposit
Role
Use Case
CIS 554
21
Class Diagram
class role association name Customer -corporation owns4 1 -overseas Portfolio * 1 contains multiplicity * Instrument strict aggregation -discount broker 3 manages 1 Stock Broker 1 association
generalization (inheritance)
Bond
Stock
Mutual Fund
CIS 554
22
Object Diagram
IBM:Customer MegaFund:Portfolio George:Stock Broker
contains
contains
Asia:Mutual Fund
Europe:Mutual Fund
CIS 554
23
Structure Diagram
CIS 554
24
Component Diagram
Window Handler .src Window Handler .obj Graphics Lib
Main .src
Main .obj
CIS 554
25
Package Diagram
Resource Manager
Window Manager
DiskDrives
KeyBoard
CIS 554
26
Deployment Diagram
Client A: Compaq Pro
CIS 554
27
Sequence
Depicts timing of events in a sequential top to bottom, left to right fashion.
Collaboration
Depicts timing of events using a sequential numbering.
CIS 554
28
Activity
Depicts the activities performed in an operation , though it can also be used to describe other activity flows, such as a use case or an interaction.
CIS 554
29
Sequence Diagram
: Computer Us er :Computer :PrintServer :Printer :Queue 1: Print (file) 2: Print (file) 3: Queue Job 4: Send J ob to Printer 5: Print Complete
CIS 554
30
Collaboration Diagram
:Computer :Queue
:Printer
CIS 554
31
State Diagram
On First Floor go up( floor ) Moving Up arrive at first floor Moving To First Floor arrive at floor go up( floor )
Moving Dow n
arrive at floor
Idle
go dow n( floor )
time-out
CIS 554
32
Activity Diagrams
CIS 554
33
CIS 554
34
Class Diagram
::TapeDeck currentState : boolean TurnON () Play () Stop () TurnOFF () ::Amplifier currentVolume : short 1 currentState : boolean TurnON () SetVolume () AmplifySignal () AdjustPreampInput () 1
CIS 554
35
Activity Diagram
User Speaker TapeDeck Amplifier
Turn Stereo ON
Push ON Button
TapeDeck.TurnON
Push ON Button
Amplifier.TurnON
ON Indicator Illuminated
View Equipment ON
ON Indicator Illuminated
P res s P lay
TapeDeck.Play
Amplifier.AmplifySignal
S et V olum e
Amplifier.SetVolume
Listen to Music
CIS 554
36
Sequence Diagram
User Instance :TapeDeck TurnON TurnON Play OutputSound SetVolume Instance :Amplifier Instance :Speaker
Turn Stereo ON
Turn Amp ON
Listen to Music
CIS 554
37
Thoughts on OOAD/UML
The OOAD methodology, and any process that uses it, will only work if the entire project team embraces it. Everyone from the Program Manager on down must be convinced of its utility. You cannot implement a system successfully unless the entire system is analyzed and developed in a consistent manner. As a minimum, the system must go through the Requirements and Analysis phases using Use Cases. More on this later. Most importantly, the systems and software teams must be an integrated team to gain the most benefits.
CIS 554
38
CIS 554
39
CIS 554
41
UML Resources
http://www.rational.com Rational site with a plethora of information about UML and the Rational process. http://www.omg.org/technology/documents/formal/uml.htm UML 2.0 specification
CIS 554
42