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

Slides:



Advertisements
Similar presentations
Informática II Prof. Dr. Gustavo Patiño MJ
Advertisements

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor.
Object-Oriented Analysis and Design
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object Oriented Analysis and Design Using the UML
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Data and Process Modeling
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
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.
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.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 18. Review User interface Design principles Design Guidelines.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Systems Analysis and Design in a Changing World, 3rd Edition
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
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.
What is a Structural Model?
1 The Unified Modeling Language. 2 The Unified Modeling Language (UML) is a standard language for writing software blueprints. The UML may be used to.
Kal Bugrara, Ph.DSoftware Engineering Northeastern University Fundamentals Of Software Engineering Lecture V.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis.
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Module 7: Other UML Diagrams.
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.
Identifying classes, Packages and drawing class Diagrams, Object Diagrams and composite structure diagrams Week 07 1.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Concepts of Object Orientation lecture 1 –b. Objectives: Concepts of Object Orientation OOAD 2  Explain the basic principles of object orientation 
Introduction to OOAD and UML
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
The Movement To Objects
Course Outcomes of Object Oriented Modeling Design (17630,C604)
COMPONENT & DEPLOYMENT DIAGRAMS
Object-Oriented Analysis and Design
Concepts of Object Orientation
Today’s Objectives Define the Problem Domain
Object Oriented Analysis and Design Using the UML Version 4.2
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design Using the UML
Object Oriented Analysis and Design Using the UML
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Mastering Object-Oriented Analysis and Design with UML Module 2: Concepts of Object Orientation

OOAD – Dr. A. Alghamdi 2 Objectives: Concepts of Object Orientation  Explain the basic principles of object orientation  Define the basic concepts and terms of object orientation and the associated UML notation  Demonstrate the strengths of object orientation  Present some basic UML modeling notation

OOAD – Dr. A. Alghamdi 3 Best Practices Implementation  Object technology helps implement these Best Practices.  Develop Iteratively: tolerates changing requirements, integrates elements progressively, facilitates reuse.  Use Component-Based Architectures: architectural emphasis, component- based development.  Model Visually: easy understanding, easy modification.

OOAD – Dr. A. Alghamdi 4 What Is Object Technology?  Object technology  A set of principles guiding software construction together with languages, databases, and other tools that support those principles. (Object Technology: A Manager’s Guide, Taylor, 1997)

OOAD – Dr. A. Alghamdi 5 Strengths of Object Technology  Provides a single paradigm  A single language used by users, analysts, designers, and implementers  Facilitates architectural and code reuse  Models more closely reflect the real world  More accurately describes corporate entities  Decomposed based on natural partitioning  Easier to understand and maintain  Provides stability  A small change in requirements does not mean massive changes in the system under development  Is adaptive to change

OOAD – Dr. A. Alghamdi 6 What Is a Model?  A model is a simplification of reality.

OOAD – Dr. A. Alghamdi 7 Why Do We Model?  We build models to better understand the system we are developing.  Modeling achieves four aims. It:  Helps us to visualize a system as we want it to be.  Permits us to specify the structure or behavior of a system.  Gives us a template that guides us in constructing a system.  Documents the decisions we have made.  We build models of complex systems because we cannot comprehend such a system in its entirety.

OOAD – Dr. A. Alghamdi 8 Truck Chemical Process Linked List What Is an Object?  Informally, an object represents an entity, either physical, conceptual, or software.  Physical entity  Conceptual entity  Software entity

OOAD – Dr. A. Alghamdi 9 A More Formal Definition  An object is an entity with a well-defined boundary and identity that encapsulates state and behavior.  State is represented by attributes and relationships.  Behavior is represented by operations, methods, and state machines. Object Operations Attributes

OOAD – Dr. A. Alghamdi 10 An Object Has State  The state of an object is one of the possible conditions in which the object may exist.  The state of an object normally changes over time. Name: J Clark Employee ID: HireDate: 07/25/1991 Status: Tenured Discipline: Finance MaxLoad: 3 Name: J Clark Employee ID: Date Hired: July 25, 1991 Status: Tenured Discipline: Finance Maximum Course Load: 3 classes Professor Clark

OOAD – Dr. A. Alghamdi 11 An Object Has Behavior  Behavior determines how an object acts and reacts.  The visible behavior of an object is modeled by the set of messages it can respond to (operations the object can perform). Professor Clark’s behavior Submit Final Grades Accept Course Offering Take Sabbatical Maximum Course Load: 3 classes SubmitFinalGrades() AcceptCourseOffering() TakeSabbatical() Professor Clark SetMaxLoad()

OOAD – Dr. A. Alghamdi 12 An Object Has Identity  Each object has a unique identity, even if the state is identical to that of another object. Professor “J Clark” teaches Biology

OOAD – Dr. A. Alghamdi 13 Representing Objects in the UML  An object is represented as a rectangle with an underlined name. Professor J Clark J Clark : Professor : Professor Named Object Unnamed Object

OOAD – Dr. A. Alghamdi 14 Class > What Are Stereotypes?  Stereotypes define a new model element in terms of another model element.  Sometimes you need to introduce new things that speak the language of your domain and look like primitive building blocks. Stereotype

OOAD – Dr. A. Alghamdi 15 Basic Principles of Object Orientation Abstraction Hierarchy Object Orientation Encapsulation Modularity

OOAD – Dr. A. Alghamdi 16 What Is Abstraction?  The essential characteristics of an entity that distinguish it from all other kinds of entities  Defines a boundary relative to the perspective of the viewer  Is not a concrete manifestation, denotes the ideal essence of something

OOAD – Dr. A. Alghamdi 17 Example: Abstraction Student Professor Course Offering (9:00 AM, Monday-Wednesday-Friday) Course (e.g., Algebra)

OOAD – Dr. A. Alghamdi 18 What Is Encapsulation? Improves Resiliency  Hide implementation from clients.  Clients depend on interface.

OOAD – Dr. A. Alghamdi 19 Encapsulation Illustrated  Professor Clark needs to be able to teach four classes in the next semester. SubmitFinalGrades() AcceptCourseOffering() TakeSabbatical() Professor Clark SetMaxLoad() Name: J Clark Employee ID: HireDate: 07/25/1991 Status: Tenured Discipline: Finance MaxLoad:4 SetMaxLoad(4)

OOAD – Dr. A. Alghamdi 20 What Is Modularity?  Modularity is the breaking up of something complex into manageable pieces.  Modularity helps people to understand complex systems.

OOAD – Dr. A. Alghamdi 21 Example: Modularity  For example, break complex systems into smaller modules. Billing System Course Registration System Course Catalog System Student Management System

OOAD – Dr. A. Alghamdi 22 What Is Hierarchy? Decreasing abstraction Increasing abstraction Asset RealEstate Savings BankAccount CheckingStock Security Bond Elements at the same level of the hierarchy should be at the same level of abstraction.

OOAD – Dr. A. Alghamdi 23 What Is a Class?  A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.  An object is an instance of a class.  A class is an abstraction in that it  Emphasizes relevant characteristics.  Suppresses other characteristics. Class + attribute + operation()

OOAD – Dr. A. Alghamdi 24 Representing Classes in the UML  A class is represented using a rectangle with compartments. Professor J Clark Professor - name - employeeID : UniqueID - hireDate - status - discipline - maxLoad + submitFinalGrade() + acceptCourseOffering() + setMaxLoad() + takeSabbatical()

OOAD – Dr. A. Alghamdi 25 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.  Classes are not collections of objects. Professor Meijer Professor Allen Professor Torpie Professor

OOAD – Dr. A. Alghamdi 26 What Is an Attribute?  An attribute is a named property of a class that describes a range of values that instances of the property may hold.  A class may have any number of attributes or no attributes at all. Attributes Student - name - address - studentID - dateOfBirth

OOAD – Dr. A. Alghamdi 27 What Is an Operation?  An operation is the implementation of a service that can be requested from any object of the class to affect behavior.  A class may have any number of operations or none at all. Operations + getTuition() + addSchedule() + getSchedule() + deleteSchedule() + hasPrerequisites() Student

OOAD – Dr. A. Alghamdi 28 What Is Polymorphism? Manufacturer A Manufacturer B Manufacturer C OO Principle: Encapsulation  The ability to hide many different implementations behind a single interface

OOAD – Dr. A. Alghamdi 29 Example: Polymorphism StockBondMutual Fund getCurrentValue() financialInstrument.getCurrentValue() getCurrentValue()

OOAD – Dr. A. Alghamdi 30 Realization relationship (stay tuned for realization relationships) What Is an Interface?  Interfaces formalize polymorphism  Interfaces support “plug-and-play” architectures Shape + draw() + move() + scale() + rotate() > Tube Pyramid Cube

OOAD – Dr. A. Alghamdi 31 Elided/Iconic Representation (“lollipop”) Canonical (Class/Stereotype) Representation How Do You Represent an Interface? Shape + draw() + move() + scale() + rotate() > Shape Tube Pyramid Cube Tube Pyramid Cube

OOAD – Dr. A. Alghamdi 32  A package is a general-purpose mechanism for organizing elements into groups.  It is a model element that can contain other model elements.  A package can be used:  To organize the model under development.  As a unit of configuration management. What Is a Package? UniversityArtifacts

OOAD – Dr. A. Alghamdi 33 What Is a Subsystem?  A combination of a package (can contain other model elements) and a class (has behavior)  Realizes one or more interfaces which define its behavior OO Principles: Encapsulation and Modularity InterfaceRealizationSubsystem SubsystemName > Interface1 (stay tuned for realization relationships)

OOAD – Dr. A. Alghamdi 34  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  An executable component What Is a Component? OO Principle: Encapsulation Source File Name > Component Name Component Interface > Executable Name

OOAD – Dr. A. Alghamdi 35 Subsystems and Components  Components are the physical realization of an abstraction in the design  Subsystems can be used to represent the component in the design Design ModelImplementation Model Component Name > Component Name Component Interface OO Principles: Encapsulation and Modularity

OOAD – Dr. A. Alghamdi 36 Components UML 1.4 and Beyond  UML 1.4 introduces concept of Artifacts:  An Artifact represents a physical piece of information that is used or produced by a software development process. Examples of Artifacts include models, source files, scripts, and binary executable files.  To distinguish between artifacts in general, and the artifacts that make up the implementation, we introduce a new term:  Implementation Element - the physical parts (UML artifacts) that make up an implementation, including software code files (source, binary or executable), and data files.

OOAD – Dr. A. Alghamdi 37 Components UML 1.4 and Beyond (cont.)  Component becomes similar to subsystem:  can group classes to define a larger granularity units of a system  can separate the visible interfaces from internal implementation  can have instances that execute at run-time  The distinction between "component" and "artifact" is new in UML 1.4.  Many tools, profiles, and examples continue to use "component" to represent implementation elements.

OOAD – Dr. A. Alghamdi 38 What Is an Association?  The semantic relationship between two or more classifiers that specifies connections among their instances  A structural relationship, specifying that objects of one thing are connected to objects of another Course > Student > Schedule >

OOAD – Dr. A. Alghamdi 39 What Is Multiplicity?  Multiplicity is the number of instances one class relates to ONE instance of another class.  For each association, there are two multiplicity decisions to make, one for each end of the association.  For each instance of Professor, many Course Offerings may be taught.  For each instance of Course Offering, there may be either one or zero Professor as the instructor. Professor > CourseOffering > * + instructor

OOAD – Dr. A. Alghamdi 40 Multiplicity Indicators * 0..* 1 * 2, 4..6 Unspecified Exactly One Zero or More Zero or One ( optional scalar role ) One or More Specified Range Multiple, Disjoint Ranges Zero or More

OOAD – Dr. A. Alghamdi 41 What Is Aggregation?  An aggregation is a special form of association that models a whole-part relationship between an aggregate (the whole) and its parts.  An aggregation is an “Is a part-of” relationship.  Multiplicity is represented like other associations. PartWhole 0..11

OOAD – Dr. A. Alghamdi 42 What Is Navigability?  Indicates that it is possible to navigate from a associating class to the target class using the association RegistrationController > CourseOffering > Schedule >

OOAD – Dr. A. Alghamdi 43 Relationships: Dependency  A relationship between two model elements where a change in one may cause a change in the other  Non-structural, “using” relationship Package Class Dependency relationship Component Client ClientPackageSupplierPackage Supplier ClientSupplier Dependency relationship Dependency relationship

OOAD – Dr. A. Alghamdi 44 What Is 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  Single inheritance  Multiple inheritance  Is an “is a kind of” relationship

OOAD – Dr. A. Alghamdi 45 Example: Single Inheritance  One class inherits from another Superclass (Parent) (Ancestor) Subclass (Child) (Descendents) Generalization Relationship Checking Savings Account - balance - name - number + withdraw() + createStatement()

OOAD – Dr. A. Alghamdi 46 Example: Multiple Inheritance  A class can inherit from several other classes. Use multiple inheritance only when needed and always with caution! FlyingThingAnimal HorseWolfBirdHelicopterAirplane Multiple Inheritance

OOAD – Dr. A. Alghamdi 47 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 – Dr. A. Alghamdi 48 Superclass (Parent) Subclass (Child) generalization Example: What Gets Inherited CarTrailerTruck Person + owner 0..*1 GroundVehicle

OOAD – Dr. A. Alghamdi 49  One classifier serves as the contract that the other classifier agrees to carry out, found between:  Interfaces and the classifiers that realize them  Use cases and the collaborations that realize them What Is Realization? CollaborationUseCase Subsystem > Interface Class Interface Component Interface

OOAD – Dr. A. Alghamdi 50 What Are Notes?  A comment that can be added to include more information on the diagram  May be added to any UML element  A “dog eared” rectangle  May be anchored to an element with a dashed line MaintainScheduleForm There can be up to one MaintainScheduleForm per user session.

OOAD – Dr. A. Alghamdi 51 Review: Concepts of 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 the two?  What is an attribute?  What is an operation?  What is polymorphism? What is an interface?

OOAD – Dr. A. Alghamdi 52 Review: Concepts of Object Orientation (cont.)  What is a package?  What is a subsystem? 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  What are stereotypes?