Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 2 (b) Object Modeling Prof. Dr. Thomas.

Slides:



Advertisements
Similar presentations
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 9b Triangulated Networks Prof. Dr. Thomas.
Advertisements

Department of Geoinformation Science Technische Universität Berlin Geo-Databases: lecture 8 Management of Spatial Data Prof. Dr. Thomas H. Kolbe Institute.
Inheritance. Many objects have a hierarchical relationship –Examples: zoo, car/vehicle, card game, airline reservation system Inheritance allows software.
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 9a Triangulated Networks Prof. Dr. Thomas.
Module 8 “Polymorphism and Inheritance”. Outline Understanding Inheritance Inheritance Diagrams Constructors in Derived Classes Type Compatibility Polymorphism.
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 20 Object Oriented Theory II.
Object–Orientated Design. OOP Design Describe the following: a computer a university Usually the most natural way to describe a task is to list the entities.
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Inheritance COMP53 Sept Inheritance Inheritance allows us to define new classes by extending existing classes. A child class inherits all members.
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
1 Evan Korth New York University Inheritance and Polymorphism Professor Evan Korth New York University.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Computer Science I Inheritance Professor Evan Korth New York University.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Unified Modeling Language
Chapter 14: Object-Oriented Data Modeling
Object Oriented Programming: Inheritance Chapter 9.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
1 Announcements Research Paper due Friday November 19 For Wednesday read
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
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.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 3 Mapping of OO Models onto Tables Prof.
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences University of Scranton October 18, 2015October 18, 2015October 18, 2015.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Object-Oriented Design CSC 212. Announcements This course is speeding up and we are starting new material. Please see me if you feel this is going too.
Peyman Dodangeh Sharif University of Technology Fall 2014.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Keys for Relationship Sets The combination of primary keys of the participating entity sets forms a super key of a relationship set. – (customer-id, account-number)
Object Oriented Programming
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Chapter 12 Object-oriented design for more than one class.
Object Oriented Programming: Inheritance Chapter 9.
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
Object Oriented Analysis and Design Using the UML
© 2007 Lawrenceville Press Slide 1 Chapter 9 Inheritance  One class is an extension of another.  Allows a class to define a specialized type of an existing.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
CS 116 OBJECT ORIENTED PROGRAMMING II LECTURE 6 Acknowledgement: Contains materials provided by George Koutsogiannakis and Matt Bauer.
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences University of Scranton August 19, 2005.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
SUBCLASSES - JAVA. The Purpose of Subclasses Class Farm String getOwner() void setOwner(String s) int getSize() void setSize(int s) Class DairyFarm String.
Lec-4 : Unified Modeling Language (UML)
Python First Edition STARTING OUT WITH Chapter 10 Inheritance
One class is an extension of another.
Advanced Programming in Java
Road Map Inheritance Class hierarchy Overriding methods Constructors
Object-oriented programming principles
Geo-Databases: lecture 7 Database design
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences
UML UML Data Modeling.
CSC 205 Java Programming II
UML UML to Relations.
One class is an extension of another.
UML Class Diagrams: Basic Concepts
Lec 3: Object-Oriented Data Modeling
Chapter 20 Object-Oriented Analysis and Design
UML UML to Relations.
Geo-Databases: lecture 2 The Relational Data Model
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Geo-Databases: lecture 5 Data Manipulation in SQL
Geo-Databases: lecture 6 Data Integrity
Geo-Databases: lecture 3 Simple Queries in SQL
Geo-Databases: lecture 4 Complex Queries in SQL
Programming in C# CHAPTER 5 & 6
Computer Science II for Majors
Presentation transcript:

Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 2 (b) Object Modeling Prof. Dr. Thomas H. Kolbe Institute for Geodesy and Geoinformation Science Technische Universität Berlin Credits: This material is mostly an english translation of the course module no. 2 (‘Geoobjekte und ihre Modellierung‘) of the open e-content platform

2 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Generalization  Specialization  Abstraction principle for the hierarchical structuring of a model  a specialized class concretises a more general class by adding specific properties;  the general class is called superclass, the specialized class subclass;  one superclass can have different subclasses also: one subclass can have different superclasses (also called parent classes) general class specialized class generalization specialization

3 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 OO: Example #1 for generalization, specialization  „staff_member“ is a more general concept as „non_ research_associate“, „research_associate“ or „professor“  „staff_member“ is the superclass  „non_ research_associate“, „research_associate“, and „professor“ are subclasses staff_member research_associateprofessornon_ research_associate

4 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 OO: Example #2 for generalization, specialization geometrical figure circlerectangletriangle  „geometrical figure“ is a more general concept than „triangle“, „circle“ or „rectangle“

5 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Taxonomy  generalization and specialization describe a taxonomical (i.e. systematic) relationship between general and specific concepts Example: Taxonomy of flies with two wings (from biology) Diptera – Flies (with two wings) Brachycera - flies Nematocera - mosquito Orthorrhapha Cyclorrhapha Aschiza Schizophora Acalyptratae Calyptratae

6 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Aggregation vs. Generalization What is the difference between an aggregation and a generalization? aggregation and generalization build hierarchies, but :  aggregation relates objects  generalization relates classes  Please note the systematic difference between following relationships University – Faculty (aggregation of objects) Rectangle – Figure (generalization of the same object)

7 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Inheritance and specialization (I) A superclass represents a concept. A subclass specializes this concept, such that that it  explicitly adopts the attributes of the superclass Inheritance of properties  explicitly adopts or overrides methods of the superclass Inheritance of the behavior  defines new attributes  defines new methods

8 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Example #1 for Inheritance student - name - first name - registration number - subject - address - date of birth - registration-date - Bachelor - Master staff member - name - first name - personnel number - institute - address - date of birth - bank account no. - salary

9 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Example #1 for Inheritance student - registration number - subject - registration-date -... staff member - personnel number - bank account no. - salary -... person - name - first name - address - date of birth

10 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Example #2: Overriding geometrical figure circlerectangletriangle -center: Point -visible: Boolean +display ( ) +delete ( ) +move ( ) -a: number -b: number -c: number +display ( ) +delete ( ) -a: number -b: number +display ( ) +delete ( ) -radius: number +display ( ) +delete ( )

11 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Inheritance and specialization (II)  subclasses differ systematically wrt. each other  attributes and methods of a class represent a self- contained concept  the specialized class is fully compatible to the general class  attributes and methods of the superclass do not have to be repeated in the specification of the subclass(es) geometrical figure circle rectangletriangle -center: Point -visible: Boolean +display( ) +delete( ) +move( ) -a: number -b: number -c: number +display ( ) +delete ( ) -a: number -b: number +display ( ) +delete ( ) -radius : number +display( ) +delete( )

12 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Object-orientation: Polymorphism  congeneric (similar) methods, that are to be executed on objects of different classes, can be named with the same identifier  when calling such a method, the (most) object- specific one is activated in each case  advantage of the polymorphism: specific objects can be handled in a general way triangles, circles, and rectangles can be treated as geometrical figures geometrical figure circle rectangletriangle -center: Point -visible: Boolean +display ( ) +delete ( ) +move ( ) -a: number -b: number -c: number +display( ) +delete( ) -a: number -b: number +display ( ) +delete ( ) -radius : number +display ( ) +delete ( )

13 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2 with spatial reference

14 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2: state - district - municipality - parcel state district municipalityproperty 1..* -name: string -inhabitants: number -area: number +getname( ): name +getinhabitants( ):number +getarea( ): number -name: string -inhabitants: number -area: number +getname( ): string +getinhabitants( ):number +getarea( ): number -owner: Person -area: number +getowner( ): Person +getarea( ): number -name: string -inhabitants: number -area: number +getname( ): string +getinhabitants( ):number +getarea( ): number Declare the attributes Declare the methodsName the relationshipsDeclare the multiplicities 1..*

15 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2: property - parcel - polygon Can this subdivision of space can be extended further than "property"? at first: transition from the legal object "property" to the geometrical object "polygon" property parcelpolygon 1.. n geometry

16 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2: Topological relationships of polygons face node edge bounds

17 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2: polygon – edge – node - point polygonedge pointnode * 2.. *  bounds  bounds geometry Declare the multiplicitys and names Name the relationships

18 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Example #2: Class ‘point‘ point - latitude: degree - longitude: degree - X: number - Y: number - projection: text - registration: text=“GPS“ - registration-date: date + getlatitude( ) : degree + getlongitude( ) : degree + setlatitude(lat: degree) + setlongitude(lon: degree) + getX( ) : number + getY( ) : number +...

19 T. H. Kolbe – Geoinformation Technology: lecture 2 Department of Geoinformation Science WS 2006/07 Data Modelling Literature Balzert, Heide: Lehrbuch der Objektmodellierung. Akademischer Verlag, 1999 Oestereich, Bernd: Objektorientierte Softwareentwicklung: Analyse und Design mit der Unified Modeling Language. 4. Auflage - Oldenbourg, München Wien, 1998 (english titles will be added soon)