Object Modeling (1) Chapter 3 (1) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha

Slides:



Advertisements
Similar presentations
Introduction to Object-Oriented Programming CS 21a: Introduction to Computing I First Semester,
Advertisements

Chapter 14 (Web): Object-Oriented Data Modeling
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
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.
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Chapter Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20.
Polymorphism. Lecture Objectives To understand the concept of polymorphism To understand the concept of static or early binding To understand the concept.
Chapter 1 Introduction.
Foundations: Language Mechanisms and Primitive OO Concepts Lecture 3: Introduction to OO Modeling E. Kraemer adapted from K. Stirewalt.
Generic Subroutines and Exceptions CS351 – Programming Paradigms.
Inheritance and Polymorphism CS351 – Programming Paradigms.
Chapter 14: Object-Oriented Data Modeling
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
CSC3170 Introduction to Database Systems
Chapter 13 (Online): Object-Oriented Databases
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Introduction to Object-oriented programming and software development Lecture 1.
Java Language and SW Dev’t
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Object-Oriented Analysis and Design An Introduction.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Programming With Java ICS201 University Of Hail1 Chapter 13 Interfaces.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Class Modeling. Basic Class Modeling Concepts Object Class Link Association Generalization Inheritance.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Object Modeling (2) Chapter 3 (2) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
The OO Solution The OO model closely resembles the problem domain
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
Design? !… When it needs? To understand, to communicate with customers Complex problem What is good design? Separate What to do?(Policy) and How to do(mechanism)
Slide Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Design Model Lecture p6 T120B pavasario sem.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Overriding toString()
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Chapter 5 Objects and Classes Inheritance. Solution Assignments 3 & 4 Review in class…..
1 Software Engineering Dr. K. T. Tsang Lecture 5 Class modeling
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
Data Modeling Using the Entity- Relationship (ER) Model.
Interfaces and Inner Classes
Business Applications with Object-Oriented Paradigm (Modeling Concepts) Professor Chen School of Business Gonzaga University Spokane, WA
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
Mapping associations with and without attributes using: references (reference collections) association arrays.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
1 CS 430 Database Theory Winter 2005 Lecture 3: A Fifty Minute Introduction to Data Modeling.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Data Modeling Using the Entity- Relationship (ER) Model
Modeling with UML – Class Diagrams
Data Modeling Using the Entity- Relationship (ER) Model
Object-oriented Programming in Java
Visit for more Learning Resources
The OO Solution The OO model closely resembles the problem domain
Appendix D: Network Model
The OO Solution The OO model closely resembles the problem domain
UML Class Diagrams: Basic Concepts
Introduction to Computer Programming
Inheritance Inheritance is a fundamental Object Oriented concept
Cheng (Sp2001): Object-Oriented Development Overview
Presentation transcript:

Object Modeling (1) Chapter 3 (1) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha

Lecture Outline  Introduction  Object and Classes  Links and Associations

Introduction  Object model  Static structure of a system by showing the objects in the system, relationships between the objects, and the attributes and operations that characterize each class of objects  Most important of the three models  Important concepts  Object, class, link, association, generalization, inheritance

Object and Classes  Objects  An object is simply something that makes sense in an application context e.g. Joe Smith, Simplex company, Lassie, process number 7648  Our definition A concept, abstraction, or thing with crisp boundaries and meaning for the problem at hand  Purposes Promote understanding of the real world Provide a practical basis for computer implementation  Decomposition of a problem into objects Depend on judgment and the nature of problem There is no one correct representation

Object and Classes  Classes  A group of objects with similar properties (attributes), common behavior (operations), common relationships to other objects, and common semantics  Objects in a class have the same attributes and behavior patterns share a common semantic purpose e.g. barn and horse with attributes of cost and age

Object and Classes  Classes (cont’)  We focus on object modeling, but why do we consider class? By grouping objects into classes, we abstract a problem! Common definitions and operations can be written once public class Vector { double x; double y; double length() { double len = Math.sqrt(x * x + y * y); return len; }

Object and Classes  Classes (cont’)  Each object “knows” its class Most object-oriented programming languages can determine an object’s class at runtime An object’s class is an implicit property of the object

Object and Classes  Each object “knows” its class  a.k.a. Run-Time Type Information (RTTI)  instanceof keyword in case of Java  But, someone doesn’t like RTTI public class Vector {... public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof Vector) { Vector v = (Vector)obj; return x == v.x && y == v.y; } return false; }

Object and Classes  Two types of object diagram  Class diagram Schema, pattern or template for describing many possible instances of data  Instance diagram How a particular set of objects relate to each other Useful for documenting test cases (especially scenarios) and discussing examples  A given class diagram corresponds to an infinite set of instance diagrams Person (Person) Joe Smith (Person) Mary Sharp (Person)

Object and Classes  Attribute  Data value held by the objects in a class  Should be a pure data value, not an object Pure data values do not have identity c.f. String object in case of Java  Each object has its own (internal) identity Do not confuse internal identity with real-world attributes e.g. SSN Person (Person) Joe Smith 24 (Person) Mary Sharp 52 name: string age: integer Person person ID: ID name: string age: integer Person name: string age: integer

Object and Classes  Operation  Function or transformation that may be applied to or by objects in a class  All object in a class share the same operations  Each operation has a target object as an implicit argument

Object and Classes  Operation (cont’)  Methods The same operation may apply to many different classes Such an operation is polymorphic Method is the implementation of an operation for a class  Queries Those that merely compute a function value without modifying any objects e.g. length() method of our Vector Base attribute vs. derived attributes The choice of base attributes is arbitrary but should be made to avoid over-specifying the state of object e.g. (x, y) vs. (ux, uy) & len in case of our Vector

Object and Classes  Operation (cont’) Person name age change-job change-address Geometric object color position move(delta: Vector) select(p: Point): Boolean rotate(angle)

Links and Associations  Link  A physical or conceptual connection between object instances  Association  A group of links with common structure and common semantics  Inherently bidirectional Country name City name Has-capital (Country) Canada (City) Ottawa Has-capital (Country) France (City) Paris Has-capital (Country) Senegal (City) Dakar Has-capital

Links and Associations  Association (cont’)  Associations are often implemented in programming language as “pointers” from one object to another e.g. “references” in case of Java PersonCompany Works-for public class Person { Company employer; } public class Company { Person employee; }

Links and Associations  Association (cont’)  Implementing associations as pointers is perfectly acceptable, but associations should not be modeled this way (why?) PersonCompany Works-for public class Person { Company employer; } public class Company { Person employee; } public static void main(String[] args) { Person p = new Person(); Company c = new Company(); p.employer = c; c.employee = p; }

Links and Associations  Example in CAD  Lines and points c.f. multiplicity symbols (solid balls and “2+”)  Sample data Could you draw an instance diagram for the sample data? Line name Point name Intersects 2+ L5 L3 L2 L4 L1 P1 P2

Links and Associations  Order of association  Binary, ternary, or higher order e.g. ternary association ProjectLanguage Person (Project) accounting (Language) Cobol (Person) Mary (Project) CAD (Language) C

Links and Associations  Order of association (cont’)  Q: same or not? ProjectLanguage Person ProjectLanguage Person

Homework  HW6: exercise 3.1 (p. 49)  HW7: write Java code of representing the instance diagram in Figure 3.7 (p. 29)