P. 1
Ooad Overview

Ooad Overview

|Views: 3|Likes:
Published by tmkiran

More info:

Published by: tmkiran on Aug 06, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less





Object Oriented Analysis And Design



What is an Object?
• A self-contained package, with specific variables (attributes) and methods (behaviors). • An object stands alone. • An object’s implementation is purposely hidden from us.

CIS 554


What is an Object?

Visual representation of a software object

CIS 554


What is an Object?

A bicycle modeled as a software object
CIS 554 4

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 5 .

• Classes just sit there. objects do the real work. • Object is run-time instance of class.What is a Class? • Class is an implementation of an abstract data type and so encapsulates both data and operations. • Memory is allocated for Objects not for Classes. CIS 554 6 .

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 7 .

audible alarm – hour hand. second hand.time of day. alarm time – Outputs . and an audible indication of a user-defined time during the day • Interface • Attributes • Behaviors – Inputs .provides time of day. bell – Increment hour. sound bell CIS 554 8 . minute hand. increment second.time of day. increment minute.Example Object • Description .

. – Specific object behavior is determined within a run-time context. Only thing exposed is the “public interface” – Creating one object from another. and hidden from the rest of us. adding to its capabilities and public interface. or within other systems.Key Object-Oriented Characteristics • Encapsulation (Information Hiding) • Inheritance – Attributes and behavior are rolled into the object. • Polymorphism • Re-useable CIS 554 9 . An object can “morph” itself based on the context in which it is currently used. – With very discrete and finite capabilities. objects can be used in other parts of the system. already defined object.

• Do we know the mechanisms for incrementing hours. etc. chronograph. minutes and seconds. CIS 554 10 .g. more complex objects requiring time. E. minutes and seconds? Sounding the alarm? – Inheritance • We can use our simple clock object to create additional. We can use it in any application that requires us to keep track of time. and alert us when a certain time has occurred. washing machine timer controller.Clock Object • How does our clock rate as an object? – Encapsulation • Provides hour. and an alarm. – Polymorphism • Not applicable – Re-usable • Our clock can be used in thousands of applications as is..

What is OOAD? • Object Oriented Analysis & Design is the art of developing systems based on a set of cooperating objects. – Smooth and natural transition occurs between analysis and design teams due to nature of defined processes. but it can never be mastered. – This stuff is not an exact science. Anyone who tells you that is mistaken. – Experience allows you to develop the craft. – Success depends upon systems analysis and software development teams understanding OOAD and available tools. CIS 554 11 .

allows you to “define” or tailor your own process. – There is no right or wrong process to implement OOAD. – A methodology. as well as the toolkits available. – The main advantage of OOAD is its integration of systems analysis and software development teams through process definition and modeling techniques available.What is OOAD? • OOAD facilitates a variety of processes for analyzing and developing systems. CIS 554 12 . Understanding the principles of OOAD.

James Rumbaugh • “A picture is worth a thousand words. Visual modeling is modeling using standard graphical notations” – Dr.” – Ancient Proverb Order Business Process Item CIS 554 Ship via 13 .Visual Modeling • “Modeling captures essential parts of the system.

specifying. and across different implementation technologies CIS 554 14 . • It can be used with all processes. and documenting the artifacts of a softwareintensive system. constructing.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. throughout the development life cycle.

What is UML? • The Unified Modeling Language is used to Specify. • It is a visual modeling tool used to implement a process and methodology. • UML captures the elements and artifacts of the development of object oriented systems and software. CIS 554 15 . Test and Document systems. • UML also facilitates the Specification and Visualization of ANY system (whether it appear as an object-oriented system or not). Implement. Visualize.

What UML is NOT • A process. Processes include: – – – – – Waterfall Spiral Development Incremental Agile etc. Third party vendors can build a tool based upon it without prior permission. • Proprietary – UML is free to use and distribute. CIS 554 16 . – Companies can use it in their design documentation without prior permission.

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 .Static Modeling • This defines the non-changing characteristics of the system.

Dynamic Modeling • This defines the changing characteristics of the system. 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 . For example: – What are the various timing aspects of the uses of the system? – What are the states.

– Depicts relationships and dependencies of classes in the system. of the system. objects) in the system. – Depicts relationships and dependencies of instantiated classes (I. or uses.UML Static Diagrams • Use Case • Class – Depicts functional capabilities. • Object CIS 554 19 .e.

• Package – Depicts relationships and dependencies of high-level components in the system. • Component – Depicts relationships and dependencies of system components. human) and the interfaces between. • Deployment – Depicts how system components are implemented in hardware in the system. software. CIS 554 20 .UML Static Diagrams • Structure Diagrams – Depicts the main components of the system (hardware.

Use Case Diagram System Boundary Actor Bank System * * * Bank Member * * ** Deposit Withdrawal * ATM * * Borrow * * Bank Manager Association Print Account Information 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 .src Main .obj Client Program .exe CIS 554 25 .obj Graphics Lib Main .

Package Diagram Resource Manager Window Manager DiskDrives KeyBoard CIS 554 26 .

Deployment Diagram Client A: Compaq Pro TCP/IP App Server: Ultra 20 TCP/IP Database Server: Ultra 20 TCP/IP Client B: Compaq Pro CIS 554 27 .

UML Dynamic Diagrams • Interaction Diagrams Depict timing of events and messages within Use Cases and classes in the system. They are interchangeable. – Sequence • Depicts timing of events in a sequential top to bottom. – Collaboration • Depicts timing of events using a sequential numbering. CIS 554 28 . left to right fashion.

• Activity – Depicts the activities performed in an operation . CIS 554 29 .UML Dynamic Diagrams • State – Depicts all the possible states that objects of the class can have. and which events cause the state to change. though it can also be used to describe other activity flows. such as a use case or an interaction.

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 6: Print Complete 7: Print Complete CIS 554 30 .

Collaboration Diagram :Computer :Queue 5: Job Complete 1: Print (file) 2: Queue Job 3: Print Job :PrintServer 4: Job Complete :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 .

Visual Modeling With Class Diagrams CIS 554 34 .

Class Diagram ::TapeDeck currentState : boolean TurnON () Play () Stop () TurnOFF () ::Amplifier currentVolume : short 1 currentState : boolean TurnON () SetVolume () AmplifySignal () AdjustPreampInput () 1 * 2.4 ::Speaker InputPower : double OverdriveAlert : boolean OutputSound () ActivateOverdriveAlert () CIS 554 35 .

SetVolume Observe Correct Volume Current Volume Indicated Listen to Music CIS 554 36 .Activity Diagram User Speaker TapeDeck Amplifier Turn Stereo ON Push ON Button TapeDeck.OutputSound S et V olum e Turn Volume Control Amplifier.TurnON ON Indicator Illuminated View Equipment ON ON Indicator Illuminated Ins ert Tape P res s P lay Push PLAY Button TapeDeck.Play Amplifier.AmplifySignal Sound Heard Speaker.TurnON Push ON Button Amplifier.

Sequence Diagram User Instance :TapeDeck TurnON TurnON Play OutputSound SetVolume Instance :Amplifier Instance :Speaker Turn Stereo ON Turn Amp ON Insert Tape Start Tape Output Signal Adjust Volume Listen to Music CIS 554 37 .

and any process that uses it. the system must go through the Requirements and Analysis phases using Use Cases. • Most importantly. – As a minimum. – More on this later.Thoughts on OOAD/UML • The OOAD methodology. the systems and software teams must be an integrated team to gain the most benefits. • Everyone from the Program Manager on down must be convinced of it’s utility. • You cannot implement a system successfully unless the entire system is analyzed and developed in a consistent manner. CIS 554 38 . will only work if the entire project team embraces it.

Model Driven Architecture (MDA) • • An approach to system development using models as a basis for understanding. construction. design. how those models are prepared and the relationships between them • • CIS 554 39 . maintenance and modification Three essential elements: – specifying a system independently of the platform that supports it. – transforming the system specification into one for a particular choice of platform. – specifying platforms. deployment. Goals: portability. interoperability and reusability Prescribes the kinds of model to be used in specifying a system. operation.

usable with different platforms of similar type. – a platform specific model (PSM): a view of a system that combines the specifications in the PIM with a specification of the use of a particular type of platform.What MDA Does • Identifies different viewpoints on a system – different abstractions .reflecting different concerns – providing a way of dealing with system complexity – a computation independent model (CIM): a view of a system that specifies its function without specifying details of its structure – a platform independent model (PIM): a view of a system that specifies its computational structure independent of any specific platform . • Specifies 3 kinds of viewpoint model for a system: • Specifies transformations between models CIS 554 40 .

MDA Ultimate Goal? • Complete. executable model. • 100% automatic code generation from the model. design and test information contained in models. CIS 554 41 . • Complete requirements.

omg.UML Resources • http://www.0 specification CIS 554 42 . • http://www.htm – UML 2.com – Rational site with a plethora of information about UML and the Rational process.org/technology/documents/formal/uml.rational.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->