1 / 19

Geoinformation Technology: lecture 2 (b) Object Modeling

Geoinformation Technology: lecture 2 (b) Object Modeling. Prof. Dr. Thomas H. Kolbe Institute for Geodesy and Geoinformation Science Technische Universität Berlin.

acanas
Télécharger la présentation

Geoinformation Technology: lecture 2 (b) Object Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 www.geoinformation.net.

  2. Object-orientation: Generalization  Specialization • Abstraction principle for the hierarchical structuring of a model • a specialized class concretises a more generalclass 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 (alsocalled parent classes) general class specialization generalization specialized class

  3. 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 non_ research_associate research_associate professor

  4. OO: Example #2 for generalization, specialization • „geometrical figure“ is a more general concept than „triangle“, „circle“ or „rectangle“ geometrical figure triangle circle rectangle

  5. 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) Orthorrhapha Brachycera - flies Cyclorrhapha Diptera – Flies (with two wings) Aschiza Schizophora Nematocera - mosquito Acalyptratae Calyptratae

  6. 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. Object-orientation: Inheritance and specialization (I) • A superclass represents a concept. • A subclass specializes this concept, such that that it • explicitlyadopts 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. Object-orientation: Example #1 for Inheritance student staff member • name • first name • registration number • - subject • address • date of birth • registration-date • Bachelor • Master • name • first name • personnel number • - institute • address • date of birth • bank account no. • salary

  9. Object-orientation: Example #1 for Inheritance person • name • first name • - address • - date of birth student staff member • - registration number • - subject • registration-date • . . . • personnel number • - bank account no. • salary • . . .

  10. Object-orientation: Example #2: Overriding geometrical figure • center: Point • visible: Boolean +display ( ) +delete ( ) +move ( ) triangle circle rectangle • radius: number • a: number • b: number • c: number • a: number • b: number +display ( ) +delete ( ) +display ( ) +delete ( ) +display ( ) +delete ( )

  11. 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 • center: Point • visible: Boolean +display( ) +delete( ) +move( ) triangle circle rectangle • radius : number • a: number • b: number • c: number • a: number • b: number +display( ) +delete( ) +display ( ) +delete ( ) +display ( ) +delete ( )

  12. 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 • center: Point • visible: Boolean +display ( ) +delete ( ) +move ( ) triangle circle rectangle • radius : number • a: number • b: number • c: number • a: number • b: number +display ( ) +delete ( ) +display ( ) +delete ( ) +display( ) +delete( )

  13. Example #2 with spatial reference

  14. Example #2: state - district - municipality - parcel state district • name: string • inhabitants: number • area: number 1..* • name: string • inhabitants: number • area: number +getname( ): string +getinhabitants( ):number +getarea( ): number +getname( ): name +getinhabitants( ):number +getarea( ): number Declare the multiplicities Name the relationships Declare the methods Declare the attributes property municipality • owner: Person • area: number • name: string • inhabitants: number • area: number 1..* 1..* +getowner( ): Person +getarea( ): number +getname( ): string +getinhabitants( ):number +getarea( ): number

  15. 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" 1 . . n property parcel polygon geometry

  16. Example #2: Topological relationships of polygons bounds node edge bounds face

  17. Example #2: polygon – edge – node - point 1..2 3 . . * polygon edge  bounds 2 . . * Declare the multiplicitys and names Name the relationships  bounds 2 1 1 geometry point node

  18. 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. 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)

More Related