OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  1998-1999 Rational Software, all rights reserved 1 Object Oriented Analysis.

Slides:



Advertisements
Similar presentations
Mastering Object-Oriented Analysis and Design with UML Module 2: Concepts of Object Orientation.
Advertisements

1 Generalizations Multiple Inheritance (finishing up Class Design) Class Design – Another Look – Part 11.
Analysis and Design with UML
Informática II Prof. Dr. Gustavo Patiño MJ
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
UML – Class Diagrams.
Object Oriented Analysis and Design Using the UML
Introduction to Object Modeling
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Use Case Analysis – continued
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Page 1 R Copyright © 1997 by Rational Software Corporation Analysis and Design with UML.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Introduction to Object Technology.
Object Oriented Analysis and Design Using the UML Version 4.2 Introduction to Object Orientation Prepared by:Kandarp R. Somaiya.
Software Construction Lecture 5 Class Diagrams. Agenda 2  Topics:  Examples of class diagrams  Navigation, visibility, named associations, and multiplicity.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
3rd Country Training, K.Subieta: System Engineering and Databases. Lecture 3, Slide 1 February 20, 2004 Lecture 3: Introduction to Software Analysis and.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Page 1  Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling captures essential parts of.
Page 1 R Copyright © 1998 by Rational Software Corporation Visual Modeling and the UML.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Lab 04.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
EC-241 Object-Oriented Programming LECTURE 9. Objectives: Introduction to Object Oriented Design Revise the basic principles of object orientation Unified.
Object Oriented Analysis & Design Using UML (CS-512) M-Tech CSE (Ist & 3rd Sem) Part Time Mr. Pawan Luthra Assistant Professor (CSE Deptt.) SBSSTC, Ferozepur.
COP43311 Copyright © 1997 by Rational Software Corporation Unified Modeling Language (UML) Based on slides and papers from Rational’s UML website
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
What is a Structural Model?
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Class Diagram. Classes Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
Relationships Relationships between objects and between classes.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Object Oriented Analysis and Design using the UML Use-Case Analysis Adapted by Dr. Spiegel from Slides Provided by Rational Software.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object Oriented Analysis and Design Using the UML
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Module 3: Concepts of Object Orientation.
Didik Dwi h t t p : / / b l o g. e l e k t r o. u m. a c. i d / d i d i k Object Oriented Software Engineering.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
Concepts of Object Orientation lecture 1 –b. Objectives: Concepts of Object Orientation OOAD 2  Explain the basic principles of object orientation 
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Course Outcomes of Object Oriented Modeling Design (17630,C604)
COMPONENT & DEPLOYMENT DIAGRAMS
Concepts of Object Orientation
UML SEQUENCE AND CLASS DIAGRAMS
Object Oriented Analysis and Design Using the UML Version 4.2
Object Oriented Analysis and Design Using the UML
UML Diagrams: The Static Model Class Diagrams
Software Engineering Lecture #11.
Object Oriented Analysis and Design Using the UML
Chapter 20 Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Presentation transcript:

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis and Design Using the UML Introduction to Object Orientation (abbreviated!)

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 2 Objectives: Introduction to Object Orientation  Understand the basic principles of object orientation  Understand the basic concepts and terms of object orientation and the associated UML notation  Appreciate the strengths of object orientation  Understand some basic UML modeling mechanisms

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 3 Object Orientation EncapsulationAbstraction Hierarchy Modularity 1. Basic Principles of Object Orientation Know This.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 4 Salesperson Not saying which salesperson – just a salesperson in general!!! Customer Product Manages Complexity What is Abstraction?

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 5 Improves Resiliency What is Encapsulation?  Hide implementation from clients  Clients depend on interface – only!  Clients do not need to know ‘how’ the server operates or provides the services! How does an object encapsulate? What does it encapsulate? DISCUSS!!!!!

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 6 Order Processing System Billing Order Entry Order Fulfillment Manages Complexity What is Modularity?  The breaking up of something complex into manageable pieces

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 7 Decreasing abstraction Increasing abstraction Asset RealEstate Savings BankAccount Checking Stock Security Bond Elements at the same level of the hierarchy should be at the same level of abstraction What is Hierarchy?  Levels of abstraction

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 8 2. Basic Concepts of Object Orientation  Object  Class  Attribute  Operation  Interface (Polymorphism)  Component  Package  Subsystem  Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 9 A More Formal Definition  An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application  An object is something that has:  State  Behavior  Identity  Know This.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 10 : Professor Professor Clark a + b = 10 ProfessorClark : Professor ProfessorClark Class Name Only Object Name Only Class and Object Name (stay tuned for classes) Representing Objects – the beginnings…  An object is represented as a rectangle with underlined name (no class name shown here) (unnamed object)

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 11 OO Principle: Abstraction What is a Class?  A class is a description of a group of objects with common properties (attributes), behavior (operations), relationships, and semantics  A class is an ‘abstraction’ of objects….  An object is an instance of a class

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 12 Professor Professor Clark a + b = 10 Representing Classes  A class is represented using a compartmented rectangle  (note: no underlining)

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 13 Professor name empID create( ) save( ) delete( ) change( ) Class Name Attributes Operations Class Compartments – a bit more development  A class is comprised of three sections  The first section contains the class name  The second section shows the structure (attributes)  The third section shows the behavior (operations)

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 14 Objects Class Professor SmithProfessor JonesProfessor Mellon Professor The Relationship Between Classes and Objects  A class is an abstract definition of an object  It defines the structure and behavior of each object in the class  It serves as a template for creating objects

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 15 :CourseOffering number = 101 startTime = 900 endTime = 1100 :CourseOffering number = 104 startTime = 1300 endTime = 1500 CourseOffering number startTime endTime Class Attribute Object Specific attribute values for different objects What is an Attribute?

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 16 CourseOffering addStudent deleteStudent getStartTime getEndTime Class Operation What is an Operation? (very general form here…) Really need to show more, but here, this is sufficient.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 17 Source File Name > Executable Name OO Principle: Encapsulation What is a Component?  A non-trivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of a well- defined architecture  A component may be  A source code component  A run time component or  An executable component > Component Name Component Interface

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 18 Package Name OO Principle: Modularity What is a Package?  A package is a general purpose mechanism for organizing like elements into groups  A model element which can contain other model elements  Think: in the Java API, similar classes are found in ‘packages’ that we may import, etc.  Uses  Organize the model under development  A unit of configuration management  Think: Math class. (contains math classes such as cos() ) Know This

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 19 Example for Data Structures Class:  Think IO package you imported.  Inside this package are many (often) unrelated classes.  FileReader  BufferedReader  FileWriter  PrinterWriter, etc.  To USE any of these classes, we merely create an object of them and proceed – independently of any other classes.  To USE any of these classes in the package, we go directly to the class, instantiate the class, and use the methods in the objects.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 20 OO Principles: Encapsulation and Modularity > Subsystem Name Interface Realization Subsystem (stay tuned for realization relationship) What is a Subsystem?  A combination of a package (contains other model elements) and a class (has behaviors)  A subsystem: realizes one or more interfaces which define its behavior  Interface is an abstract class. Subsystems implement (realize) the interface(s)… Know This.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 21 Example of Subsystems > Subsystem Name Interface Realization Subsystem Subsystem might be AccountsReceivable, AccountsPayable, Billing, That is, a major hunk of functionality. BUT, a client of the subsystem does NOT have access to the individual Classes like in a Package. Rather, a client must go through the public Interface to the subsystem, which contains the signatures of the services provided within the subsystem. The contents of the subsystem are NOT directly accesses; They are protected; Only the services shown in the interface are made available to clients.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 22 Relationships  Association  Aggregation  Composition  Dependency  Generalization  Realization

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 23 Professor University Works for Class Association Association Name ProfessorUniversity EmployerEmployee Role Names  Relationships: Association  Models a semantic connection among classes

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 24 StudentSchedule Whole Aggregation – sometimes called ‘simple aggregation.’ This is sometimes called a ‘has_a’ relationship Part Relationships: Aggregation (simple aggregate)  A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts Know This

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 25 StudentSchedule Whole Aggregation This one is called ‘composition.’ Part Relationships: Composition  A form of aggregation with strong ownership and coincident lifetimes  The parts cannot survive the whole/aggregate Know This

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 26 Association: Multiplicity and Navigation  Multiplicity defines how many objects participate in a relationship  Multiplicity is a Structural Relationship!  The number of instances (that is, ‘objects’) of one class related to ONE instance of another class (examples ahead)  Specified for each end of the association  Associations and aggregations are bi-directional by default, but it is often desirable to restrict navigation to one direction  If navigation is restricted, an arrowhead is added to indicate the direction of the navigation

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 27 Association: Multiplicity * 0..* 1 *  Unspecified  Exactly one  Zero or more (many, unlimited)  One or more  Zero or one  Specified range  Multiple, disjoint ranges 2, 4..6

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 28 StudentSchedule 10..* Multiplicity Navigation Example: Multiplicity and Navigation Note: A student has zero or more schedules. (Multiplicity) Note: Aggregation: ‘has_a’ (whole-part relationship).

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 29 ClientSupplier Package ClientPackageSupplierPackage Client Supplier Class Dependency relationship Component  Relationships: Dependency  A relationship between two model elements where a change in one may cause a change in the other  Non-structural, “using” (or “communicates”) relationship  (non-structural: no numbers of one kind related to another kind…)  Can actually say the Client ‘uses’ the Supplier. Know This

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 30  Relationships: Generalization  A relationship among classes where one class shares the structure and/or behavior of one or more classes  Defines a hierarchy of abstractions in which a subclass inherits from one or more superclasses  Generalization is a “is-a-kind of” relationship, or simply, “is_a” relationship.

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 31 Account balance name number Withdraw() CreateStatement() Checking Withdraw() Savings GetInterest() Withdraw() Superclass (parent) Subclasses Generalization Relationship Subclasses inherit both attributes and methods from base (parent) class. Ancestor Descendents Example: Single Inheritance  One class inherits from another

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 32 AirplaneHelicopterWolfHorse FlyingThingAnimal Bird multiple inheritance Use multiple inheritance only when needed, and always with caution ! Example: Multiple Inheritance  A class can inherit from several other classes

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 33 Inheritance leverages the similarities among classes What Gets Inherited?  A subclass inherits its parent’s attributes, operations, and relationships  A subclass may add:  additional attributes, operations, relationships  Redefine inherited operations (use caution!)  Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 34 Truck tonnage GroundVehicle weight licenseNumber Car owner register( ) getTax( ) Person 0..* Trailer 1 Superclass (parent) Subclass generalization size Example: What Gets Inherited (note form of arrow) What about a ‘register()’ in Car?

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 35 Use CaseUse-Case Realization Elided form Subsystem Interface Canonical form Relationships: Realization (note form of arrow)  One classifier serves as the contract that the other classifier agrees to carry out  Found between:  Interfaces and the classifiers that realize them

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 36 UML Connection Lines – Important. Know these.  Note the UML line types - important:  Dashed, arrowhead – dependency  Dashed, open triangle – ‘realizes’  Solid line, open triangle – inheritance (is_a)  Solid line, arrowhead – uses / communicates with  Solid line, diamond – aggregates (has_a))

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 37 Introduction to Object Orientation Topics  Basic Principles of Object Orientation  Basic Concepts of Object Orientation  Strengths of Object Orientation  General UML Modeling Mechanisms

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 38 > MyBoundaryClass 4. Stereotypes  Classify/extend UML notational elements  Define a new model element in terms of another model element  May be applied to all modeling elements  Represented with name in guillemets or as a different icon

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 39 There can be up to one MaintainScheduleForm per user session. MaintainScheduleForm Notes  A Note can be added to any UML element  The class diagram is the one most often extended…  Notes may be added to add more info to diagram  It is a ‘dog eared’ rectangle  The note may be anchored to an element with a dashed line

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 40 PersistentClass {persistence} anObject : ClassA {location=server} Tagged Values  Extensions of the properties, or specific attributes, of a UML element  Some properties are defined by UML  Persistence  Location (e.g., client, server)  Properties can be created by UML modelers for any purpose

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 41 Professor Department Member Department Head {subset} 1..* Constraints  Supports the addition of new rules or modification of existing rules This notation is used to capture two relationships between Professor-type objects and Department-type objects; where one relationship is a subset of another…. Shows how UML can be tailored to correctly modeling exact relationships….

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 42 (continued) Review : Introduction to Object Orientation  What are the four basic principles of object orientation?  Provide a brief description of each.  What is an Object and what is a Class?  What is the difference between them?  What is an Attribute?  What is an Operation?  What is an Interface?  What is Polymorphism?  What is a Component?

OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 43 Review : Introduction to Object Orientation (cont.)  What is a Package?  What is Subsystem?  How does it relate to a Component?  How does it relate to a package?  How does it relate to a class?  Name the four basic UML relationships and describe each.  Describe the strengths of object orientation.  Name and describe some general UML mechanisms.  What are stereotypes?  Name some common uses of stereotypes. Know This