Object Oriented Analysis and Design Using the UMLObjectives: Introduction to Object Orientation1. Basic Principles of Object OrientationWhat is Abstraction?What is Encapsulation?What is Modularity?What is Hierarchy?2. Basic Concepts of Object OrientationA More Formal DefinitionRepresenting Objects – the beginnings…What is a Class?Representing ClassesClass Compartments – a bit more developmentThe Relationship Between Classes and ObjectsWhat is an Attribute?What is an Operation? (very general form here…)What is a Component?What is a Package?Example for Data Structures Class:What is a Subsystem?Example of SubsystemsRelationships Relationships: AssociationRelationships: Aggregation (simple aggregate)Relationships: CompositionAssociation: Multiplicity and NavigationAssociation: MultiplicityExample: Multiplicity and Navigation Relationships: Dependency Relationships: GeneralizationExample: Single InheritanceExample: Multiple InheritanceWhat Gets Inherited?Example: What Gets Inherited (note form of arrow)Relationships: Realization (note form of arrow)Introduction to Object Orientation Topics4. StereotypesNotesTagged ValuesConstraintsReview: Introduction to Object OrientationReview: Introduction to Object Orientation (cont.)OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved1Object Oriented Analysis and Design Using the UMLIntroduction to Object Orientation(abbreviated!)OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved2Objectives: Introduction to Object OrientationUnderstand the basic principles of object orientation Understand the basic concepts and terms of object orientation and the associated UML notationAppreciate the strengths of object orientation Understand some basic UML modeling mechanismsOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved3Object OrientationEncapsulationAbstractionHierarchyModularity1. Basic Principles of Object OrientationKnow This.OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved4SalespersonNot saying which salesperson – just a salesperson in general!!!CustomerProductManages ComplexityWhat is Abstraction?OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved5Improves ResiliencyWhat is Encapsulation?Hide implementation from clientsClients 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.2Copyright 1998-1999 Rational Software, all rights reserved6Order Processing SystemBillingOrderEntryOrderFulfillmentManages ComplexityWhat is Modularity?The breaking up of something complex into manageable piecesOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved7Decreasing abstractionIncreasing abstractionAssetRealEstateSavingsBankAccountCheckingStockSecurityBondElements at the same level of the hierarchy should be at the same level of abstractionWhat is Hierarchy? Levels of abstractionOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved82. Basic Concepts of Object OrientationObjectClassAttributeOperationInterface (Polymorphism)ComponentPackageSubsystemRelationshipsOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved9A 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:StateBehaviorIdentityKnow This.OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved10: ProfessorProfessor Clarka + b = 10ProfessorClark : ProfessorProfessorClarkClass Name OnlyObject Name OnlyClass 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.2Copyright 1998-1999 Rational Software, all rights reserved11OO Principle: AbstractionWhat 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 classOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved12ProfessorProfessor Clarka + b = 10Representing ClassesA class is represented using a compartmented rectangle (note: no underlining)OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved13ProfessornameempIDcreate( )save( )delete( )change( )Class NameAttributesOperationsClass Compartments – a bit more developmentA class is comprised of three sectionsThe first section contains the class nameThe second section shows the structure (attributes)The third section shows the behavior (operations)OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved14ObjectsClassProfessor SmithProfessor JonesProfessor MellonProfessorThe Relationship Between Classes and ObjectsA class is an abstract definition of an objectIt defines the structure and behavior of each object in the classIt serves as a template for creating objectsOOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved15:CourseOfferingnumber = 101startTime = 900endTime = 1100:CourseOfferingnumber = 104startTime = 1300endTime = 1500CourseOfferingnumberstartTime endTimeClassAttributeObjectSpecific attribute valuesfor different objectsWhat is an Attribute?OOAD Using the UML - Introduction to Object Orientation, v 4.2Copyright 1998-1999 Rational Software, all rights reserved16CourseOfferingaddStudent
View Full Document