The OO Solution The OO model closely resembles the problem domain

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Dillon: CSE470: Object Modeling1 Requirements Model l Focus on WHAT, not HOW l Analyst needs to understand the problem »How does software fit into overall.
Conceptual Data Modeling: ER
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 CSE491-RE: UML Classes The OO Solution The OO model closely resembles the problem domain –Base your model on the objects in the problem domain Iteratively.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Chapter Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20.
Conceptual Modeling A Short Discussion. Outline Conceptual modeling The goal of conceptual modeling The OO solution The object model (conceptual) Syntax.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
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.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Lecture 13-17, chitkara university.  Gives a conceptual framework of the things in the problem space  Helps you think – focus on semantics  Provides.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Object Modeling (1) Chapter 3 (1) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
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.
The OO Solution The OO model closely resembles the problem domain
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
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.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Data Modeling Using the Entity- Relationship (ER) Model.
Object-Oriented Systems. Goals Object-Oriented Methodologies – The Rumbaugh et al. OMT – The Booch methodology – Jacobson's methodologies.
Lecture 5 Entity Relationship Modeling
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Entity Relationship (E-R) Model
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Comp 1100 Entity-Relationship (ER) Model
UML Class & Object Diagram I
Databases (CS507) CHAPTER 7.
Data Modeling Using the Entity- Relationship (ER) Model
Unified Modeling Language (UML)
Entity- Relationship (ER) Model
Chapter 9 Domain Models.
Enhanced Entity-Relationship and Object Modeling Objectives
Entity-Relationship Model
Entity Relationship Model
Visit for more Learning Resources
Object-Oriented Modeling with UML
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
The OO Solution The OO model closely resembles the problem domain
Analysis and Design with UML: Discovering Classes and Relationships
Entity-Relationship Modelling
Outline of the ER Model By S.Saha
OO Domain Modeling With UML Class Diagrams and CRC Cards
Analysis and Design with UML: Discovering Classes and Relationships
UML Class Diagrams: Basic Concepts
Analysis and Design with UML: Discovering Classes and Relationships
UML Class Diagram.
Chapter 20 Object-Oriented Analysis and Design
Entity-Relationship Modelling
Appendix A Object-Oriented Analysis and Design
Entity Relationship Model
Understand and Use Object Oriented Methods
Analysis and Design with UML: Classes and Relationships
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Introduction to Object-Oriented Software Development
Chapter 2: Entity-Relationship Model
Cheng (Sp2001): Object-Oriented Development Overview
From Class Diagram to Contract Diagram
Presentation transcript:

The OO Solution The OO model closely resembles the problem domain Base your model on the objects in the problem domain Iteratively refine the high-level model until you have an implementation Attempt to avoid big conceptual jumps during the development process CSE 435: Software Engineering

Objects VISA State of Michigan J. Q. Public 123 4567 887766 998 Drivers License State of Michigan A-123456 03-12-63 CSE 435: Software Engineering

Attributes and Operations Person class J. Q. Public VISA 123 4567 887766 998 Drivers License State of Michigan A-123456 03-12-63 Attributes name age height weight Operations move change-job width id-number issue change Person objects Card objects Card class abstracts to

Characteristics of Objects Identity Discrete and distinguishable entities Classification Abstract entities with the same structure (attributes) and behavior (operations) into classes Polymorphism The same operation may behave differently on different classes Inheritance Sharing of attributes and operations based on a hierarchical relationship CSE 435: Software Engineering

The Class Diagrams CSE 435: Software Engineering

Objects Something that makes sense in the application context (application domain) J.Q. Public Joe’s Homework Assignment 1 J. Q. Public’s drivers license All objects have identity and are distinguishable NOT objects Person Drivers license CSE 435: Software Engineering

Classes Describes a group of objects with similar properties (attributes), common behavior (operations), common relationships to other classes, and common semantics Person J. Q. Public Joe Smith D. Q. Public Card Credit card Drivers license Teller card CSE 435: Software Engineering

Class Diagrams Class diagram Instance diagram D. Q. Public: age= 32 Person J. Q. Public: age= 35 Person Person age: integer Class with attributes Objects with values Objects have an identity Do not explicitly list object identifiers SSN OK! CSE 435: Software Engineering

Examples CSE 435: Software Engineering

Operations and Methods Transformation that can be applied to or performed by an object May have arguments CSE 435: Software Engineering

Object Notation - Summary CSE 435: Software Engineering

Associations Conceptual connection between classes Class diagrams A credit card is issued-by a bank A person works-for a company Issued-by Credit Card Bank Class diagrams Works-for Person Company J.Q. Public: Person Michigan State Univ: Company Works-for Instance diagram Age=35 CSE 435: Software Engineering

Associations are Bi-directional There is no direction implied in an association (Rumbaugh - OMT) Country name City name Has-capital Person name Drivers-license lic.-number: integer Is-issued CSE 435: Software Engineering

Associations Have Direction Unified adds a direction indicator Inconsistently used Country name City name Has-capital Person name Drivers-license lic.-number: integer Is-issued CSE 435: Software Engineering

Multiplicity One person holds one credit card name: String Person card-number: integer Credit-card Holds One object can be related to many objects through the same association One person can hold zero or more credit cards Person Holds 0..* Credit-card name: String card-number: integer CSE 435: Software Engineering

Multiplicity (Cont.) One person can hold zero or more credit cards (0..*) Each card has zero or one holder (0..1) Person Credit-card 0..1 Holds 0..* name: String age: integer card-number: integer card-number= 123 456 789 Card789:Credit-Card :DQPublic:Person name= D. Q. Public age=32 :JQPublic:Person name= J. Q. Public age=35 Holds Holds card-number= 444 555 666 Card456:Credit-Card card-number= 111 222 333 Card123:Credit-Card CSE 435: Software Engineering

Higher order associations Ternary association Project, language, person Seldom needed (and should be avoided) 1..* 1..* Language Project 1..* Person Compiler: Project C++ :Language Note: hexagons should be rectangles to represent instances J. Q. Public:Person Age=35 TicTacToe:Project LISP:Language CSE 435: Software Engineering

Link Attributes How to represent salary and job title? Associations can have properties the same way objects have properties How to represent salary and job title? Person Company name: String 0..* Works-for age: integer name: String SSN: integer address: String address: String Person Company name: String 0..* Works-for age: integer name: String Use a link attribute! SSN: integer address: String address: String salary: integer job-title: String CSE 435: Software Engineering

Folding Link Attributes Why not this? Salary and job title are properties of the job not the person Person name: String Company age: integer 0..* Works-for SSN: integer name: String address: String address: String salary: integer job-title: String Person Company name: String 0..* Works-for 0..* age: integer name: String In this case, a link attribute is the only solution SSN: integer address: String address: String salary: integer job-title: String CSE 435: Software Engineering

Role Names Attach names to the ends of an association to clarify its meaning name: String age: integer SSN: integer address: String Person Company Works-for 0..* salary: integer job-title: String employer employee boss worker Manages 0..1 CSE 435: Software Engineering

Aggregation A special association, the is-part-of association A sentence is part of a paragraph (a paragraph consists of sentences) A paragraph is part of a document (a document consists of paragraphs) 0..* 0..* Document Paragraph Sentence Aggregation symbol CSE 435: Software Engineering

Aggregation (Cont.) Often used in parts explosion Car 4 Wheel Body Gearbox Engine 1..* 1..* 0..* Door Hood Trunk Piston Valve Crankshaft CSE 435: Software Engineering

Generalization and Inheritance The is-a association Cards have many properties in common Generalize the common properties to a separate class, the base-card Let all cards inherit from this class, all cards is-a base-card (plus possibly something more) issue() revoke() height: integer width: integer thickness: integer id-number: integer Card expire() class: vehicle issued: date expires: date Drivers License ID Card validate() credit-limit: integer Credit Card CSE 435: Software Engineering

Example Owns Pilot City Airline Works-for Based-In 0..* name name name license Located-In Offers 1..* Certified-On Pilots 0..* 0..* Airport 0..* Plane 0..* name Departs 0..* Flight model date serial # heat() Arrives Used-For flight # hours flown clean() 0..* cancel() heat() delay() refuel() clean() 30..* 0..* Seat Passenger location name Confirmed-for reserve()

Aggregation Versus Association Can you use the phrase is-part-of or is-made-of Are operations automatically applied to the parts (for example, move) - aggregation Not clear what it should be…… 0..* 0..* Company Division Department Works-for 0..* Person CSE 435: Software Engineering

Aggregation Versus Inheritance Do not confuse the is-a relation (inheritance) with the is-part-of relation (aggregation) Use inheritance for special cases of a general concept Use aggregation for parts explosion 4 Wheel Body Car Gearbox Engine Minivan Compact Jeep Roll Bar CSE 435: Software Engineering

Recursive Aggregates A recursive aggregate contains (directly or indirectly) an instance of the same kind of aggregate Program Simple Statement Compound Block 0..* CSE 435: Software Engineering

Class diagram Metamodel I Eclipse.org CSE 435: Software Engineering

Class diagram Metamodel II CSE 435: Software Engineering Science direct

Use Case Metamodel I uu: use case association relationship _i: includes _e: extends _g: generalization aa: actor relationship Image: Science Direct: ``Visual Modeling for Software Intensive Systems, Kooper et al, 2006. CSE 435: Software Engineering

Use Case Metamodel II CSE 435: Software Engineering Image: Jot.fm

Object Modeling Summary Classes Name Attributes Operations Associations Roles Link attributes Aggregation Inheritance CSE 435: Software Engineering