Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Analysis and Design Using the UML

Similar presentations


Presentation on theme: "Object Oriented Analysis and Design Using the UML"— Presentation transcript:

1 Object Oriented Analysis and Design Using the UML
OOADv4.2 Instructor Notes Object Oriented Analysis and Design Using the UML Introduction to Object Orientation PART 1 Module 3 - Introduction to Object Orientation

2 Objectives: Introduction to Object Orientation
OOADv4.2 Instructor Notes 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 In the Best Practices module, we discussed some characteristics common to successful projects. OO facilitates the following best practices: Develop Iteratively Model Visually Use Component Architecture Defining basic OO terms and concepts allows everyone in the class to start on a level playing field. Module 3 - Introduction to Object Orientation

3 Introduction to Object Orientation Topics
OOADv4.2 Instructor Notes Introduction to Object Orientation Topics Basic Principles of Object Orientation Basic Concepts of Object Orientation Strengths of Object Orientation General UML Modeling Mechanisms Module 3 - Introduction to Object Orientation

4 Basic Principles of Object Orientation
OOADv4.2 Instructor Notes Basic Principles of Object Orientation Object Orientation Encapsulation Abstraction Hierarchy Modularity Module 3 - Introduction to Object Orientation

5 OOADv4.2 Instructor Notes
What is Abstraction? Salesperson Not saying Which salesperson – just a salesperson in general!!! Discuss what makes a good abstraction with the students: Concise, Represents a single coherent concept, etc. Customer Product Manages Complexity Module 3 - Introduction to Object Orientation

6 OOADv4.2 Instructor Notes
What is Encapsulation? Hide implementation from clients Clients depend on interface Encapsulation is putting the “databits” and operations that manipulate them in the same place. Encapsulation DISALLOWS direct manipulation of things that have been encapsulated without utilising the supplied interface. Another example - the accelerator on a car. You put your foot down and car goes faster - this works on most cars, and you don’t worry about the cables, electronics, engine, etc. How does an object encapsulate? What does it encapsulate? Improves Resiliency Module 3 - Introduction to Object Orientation

7 OOADv4.2 Instructor Notes
What is Modularity? The breaking up of something complex into manageable pieces Modularity supports separation of concerns. Another example of modularity is a car, which is made up of a body, chassis, engine, wheels, etc. Order Entry Order Processing System Order Fulfillment Billing Manages Complexity Module 3 - Introduction to Object Orientation

8 OOADv4.2 Instructor Notes
What is Hierarchy? Asset Levels of abstraction Hierarchy is not an organizational chart. Hierarchy is not a functional decomposition. Hierarchy is a taxonomic organization. The use of hierarchy makes it easy to recognize similarities and differences. For example, in botany, plants are organized into families, chemistry uses a periodic table to organize the elements. Another example -- telephone number, then a 0800 (free call) number, premium rate number, etc Decreasing abstraction Increasing BankAccount Security RealEstate Savings Checking Stock Bond Elements at the same level of the hierarchy should be at the same level of abstraction Module 3 - Introduction to Object Orientation

9 Introduction to Object Orientation Topics
OOADv4.2 Instructor Notes Introduction to Object Orientation Topics Basic Principles of Object Orientation Basic Concepts of Object Orientation Strengths of Object Orientation General UML Modeling Mechanisms Before moving on, ask the students to name the four basic principles of OO (as a review). Module 3 - Introduction to Object Orientation

10 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

11 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

12 OOADv4.2 Instructor Notes
What is an Object? Informally, an object represents an entity, either physical, conceptual, or software Physical entity Conceptual entity Software entity Truck Chemical Process Linked List Module 3 - Introduction to Object Orientation

13 A More Formal Definition
OOADv4.2 Instructor Notes 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 Module 3 - Introduction to Object Orientation

14 OOADv4.2 Instructor Notes
Representing Objects An object is represented as rectangles with underlined names : Professor Professor Clark a + b = 10 ProfessorClark Class Name Only ProfessorClark : Professor Object Name Only Class and Object Name (stay tuned for classes) Module 3 - Introduction to Object Orientation

15 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

16 OOADv4.2 Instructor Notes
What is a Class? A class is a description of a group of objects with common properties (attributes), behavior (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 A class has been called a “cookie cutter” for objects. OO Principle: Abstraction Module 3 - Introduction to Object Orientation

17 OOADv4.2 Instructor Notes
Sample Class Class Course Properties Name Location Days offered Credit hours Start time End time Behavior Add a student Delete a student Get course roster Determine if it is full a + b = 10 Module 3 - Introduction to Object Orientation

18 OOADv4.2 Instructor Notes
Representing Classes A class is represented using a compartmented rectangle a + b = 10 Professor Professor Clark Module 3 - Introduction to Object Orientation

19 OOADv4.2 Instructor Notes
Class Compartments 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) In Rose: You may select which compartments are displayed via Diagram Object Properties for the diagram element. You may select which items appear in which compartments using the Edit Compartment function for the diagram element. Professor name empID create( ) save( ) delete( ) change( ) Class Name Attributes Operations Module 3 - Introduction to Object Orientation

20 OOADv4.2 Instructor Notes
Classes of Objects How many classes do you see? The answers you get will vary depending on the students’ perspectives on what they see, as well as the criteria they use to organize the objects shown on this slide. For example, some possible answers include: Two classes: animals and non-animals Two classes: Extinct and non-extinct things Etc. Module 3 - Introduction to Object Orientation

21 The Relationship Between Classes and Objects
OOADv4.2 Instructor Notes 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 Objects are grouped into classes This may seem repetitive with earlier slides, but it has been noted that the repetition of the discrimination between objects and classes is beneficial to “newbies”. If this does not apply to your class, you can cover this slide briefly. Objects Class Professor Smith Professor Mellon Professor Professor Jones Module 3 - Introduction to Object Orientation

22 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

23 OOADv4.2 Instructor Notes
What is an Attribute? Object Class Attribute Attribute Value :CourseOffering number = 101 startTime = 900 endTime = 1100 CourseOffering number startTime endTime :CourseOffering number = 104 startTime = 1300 endTime = 1500 Module 3 - Introduction to Object Orientation

24 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

25 OOADv4.2 Instructor Notes
What is an Operation? CourseOffering addStudent deleteStudent getStartTime getEndTime Class Operation Module 3 - Introduction to Object Orientation

26 Basic Concepts of Object Orientation
OOADv4.2 Instructor Notes Basic Concepts of Object Orientation Object Class Attribute Operation Interface (Polymorphism) Component Package Subsystem Relationships Module 3 - Introduction to Object Orientation

27 OOADv4.2 Instructor Notes
What is Polymorphism? The ability to hide many different implementations behind a single interface Polymorphism will be addressed in more detail in the Class Design module. Another example of polymorphism: There is a toddler sitting in front of some blocks and a teenager siting in front of a piano. An adult walks into the room and says “play”. The toddler plays with the blocks and the teenage plays the piano. Another example - car accelerator on different cars. Manufacturer A Manufacturer B Manufacturer C OO Principle: Encapsulation Module 3 - Introduction to Object Orientation

28 OOADv4.2 Instructor Notes
What is an Interface? Interfaces formalize polymorphism Interfaces support “plug-and-play” architectures Interfaces are not abstract classes, as abstract classes allow you to provide default behavior for some/all of their methods. Interfaces provide no default behavior. Tube Shape Draw Move Scale Rotate <<interface>> Pyramid Cube Realization relationship (stay tuned for realization relationships) Module 3 - Introduction to Object Orientation

29 Interface Representations
OOADv4.2 Instructor Notes Interface Representations Tube Elided/Iconic Representation (“lollipop”) Pyramid Shape Cube Canonical (Class/Stereotype) Representation Tube Shape Draw Move Scale Rotate <<interface>> Pyramid Cube (stay tuned for realization relationships) Module 3 - Introduction to Object Orientation


Download ppt "Object Oriented Analysis and Design Using the UML"

Similar presentations


Ads by Google