27
Key object concepts (1 of 2 ) • polymorphism behaviors of an object class can adapt to variations of object • Encapsulation object is accessed only through a well defined set of software methods this masks the internal complexity of the object from the application O B J E C T APIs

Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Embed Size (px)

Citation preview

Page 1: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Key object concepts (1 of 2 )

• polymorphism– behaviors of an object

class can adapt to variations of object

• Encapsulation– object is accessed only

through a well defined set of software methods

– this masks the internal complexity of the object from the application

OBJECT

APIs

Page 2: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Key object concepts (2 of 2)

• Inheritance– one object class can be defined to include the behaviors

of another class and to have additional behaviors of its own

• makes creation of complex objects much easier

• makes sure that important shared properties are not overlooked

– inheritance can “derive” from an abstract class or form a “real” one

• abstract class line – has various properties

– class primary line has all of line’s properties and some of its own

Page 3: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Classes and objects• abstract class

– a “template” for subclasses – cannot be used to create new objects but is a specification for

a subclass• line abstract class for primary line, secondary line

• creatable class– has objects that you can directly create

• pole, river

• instantiable class– cannot directly create new objects but objects of this class

can BE created as a property of another class (pole objects create transformer objects)

Page 4: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Relationships (1 of 3)

• associations– relationships between classes

– multiplicity constraints• 1 = one only

• 0 .. 1 = zero to one

• M .. N = from M to N

• * OR 0 .. * = from zero to any positive integer

• 1 .. * = from 1 to any positive number

– number reads from the box to the other box• A can have zero to one Bs

• B has 3 or 4 As A B0..1 3..4

Page 5: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Relationships (2 of 3)

• type inheritance– specialized classes that

share properties and methods with the superclass and also have additional properties and methods

– inheritance can be from a abstract class or from a createable class

ROW

Feature

Network feature

Complexjunction

Simplejunction

Junction feature Edge

feature

transformermeter

Page 6: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Relationships (3 of 3)

• Instantiation– object in one class has a method that

creates an object from another class• pole creates transformer

• Aggregation– asymmetric relationship in which an

object from one class is considered to be a “whole” and objects from another class are considered “parts”

• Composition– stronger form of aggregation in which

objects from the whole class control the lifetime of objects from the part class

pole trans

Page 7: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Componentization

• creation of small blocks of reusable computer code– in Microsoft use Component Object Model (COM)

– in UNIX use Common Object Request Broker Architecture (CORBA)

– multiple platforms use Java Remote Method Invocation (RMI)

• numerous advantages - some disadvantages• concept has been extended to spatial entities

Page 8: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Geodatabase

• ESRI’s new objet model– geodatabase is top level

– feature dataset• collection of feature classes, network graphs, relationships

• simple feature classes may be within or outside a feature dataset but network features must be in a feature dataset

– feature class(es)

– relationships

– TINs

– rasters

Page 9: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Feature class

• may be within a feature dataset (must if network type) or outside

– point feature class

– line feature class

– polygon feature class

– object class

– junction feature class

– edge feature class

– geometric network feature class

– relationship class

Page 10: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Workspace

• old Arc data structure– coverages

• within a workspace there can be many coverages• the georelational data model• stores geometries AND topological relationships• key types of coverages

– point (attributes in PATs)

– arcs (attributes in AATs)

» network elements and polygon boundaries

– polygons (attributes in PATs)

– regions - groups of polys

– labels (polygon markers)

– nodes (attributes in NATs)

– annotation (text on map)

Page 11: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Shapefiles and CAD files

• simple form• no topology

– shapefiles• point

• line

• polygon

• dBase tables with attributes

– CAD• point

• line

• polygon

• annotation

• drawing - representation of CAD data for drawing only

Page 12: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (1 of 6)

Geodatabases Coverages Shapefiles

DataCollection

Feature datasets,feature classes,TINS, rasters

Everything inrelationaldatabases

Topology storedonly for networkfeatures

Continuouscoverage

Behaviors closelycoupled w/relationships

Coverages, grids,TINs

Spatial in binary Attributes in

DBMS Large areas

subdivided intotiles

Can couple withwriting of customAML

Spatial in binary Attributes in relational

DBMS Doesn’t work for very large

Page 13: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (2 of 6)Geodatabases Coverages Shapefiles

Featuredataset

Simple features Topological

features – butonly fornetworks

Other topologycreated on-the-fly

Many featureclasses can beassociated witha topologicalrole

User definedassociations

Coordinatesassociated w/feature dataset

All features aretopological

Topology stored Lines use arcs,

nodes, and routes Polygons use

arcs, label points,polygons andregions

Only one featureclass can beassociated with atopological role

Definedcoordinate system

One simple feature class pershape file

Polygon topology created asneeded on-the-fly

No topology implicit in anyshapefile

No associations possible No defined coordinate

system

Page 14: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (3 of 6)Geodatabases Coverages Shapefiles

Featureclass

Each featureclass is arelational tablewith a columnfor geometry

Class types atepoint, line,polygon,annotation,simple junction,complexjunction, simpleedge andcomplex edge

Extensible

Spatial in bianry Attributes in

DBMS Primary class

types are point,arc, polygon andnode

Secondary classtypes are tic, linkand annotation

Compoundclasses are regionand route

No extensionposible

Spatial in binary Attributes in DBMS Types are point, multipoint,

line and polygon No extension

Page 15: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (4 of 6)

Geodatabases Coverages Shapefiles

Pointfeatures

Point Multipoint Network

junctions arealso

Label pointseither pointfeatures orpolygon centroids

Nodes –endpoints of arcs

Tics – forregistration

Multipoint NOTpermitted

Point Multipoint Points are NOT associated

with polygons

Page 16: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (5 of 6)Geodatabases Coverages Shapefiles

Linefeatures

Polylines Composed of

one or manypaths

Paths can beline, circulararc, ellipticalarc, bezier curve

Geometricnetworkcontainsjunctions andedges that forma one-dimensionalgraph

Straight linesegmentsterminating innodes

Cary 2D topology(right/left)

Routes composedof sections –sections are wholeor partial arc

Polyline with one path Polyline with multiple paths

Page 17: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Comparisons (6 of 6)Geodatabases Coverages Shapefiles

Polygonfeatures

One or manyrings

Ring is closednon-intersectingpath

Different ringsCAN intersecthowever.

All componentsof path arepossible inpolygon

Disjoint rings Nested rings

Planar graph Each has label

point Attributes

associated withlabel point

Region subclass isa composite ofmultiple polygons

Similar to geodatabase modelbut can ONLY be straightpaths

Disjoint rings Nested rings

Page 18: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Feature in a geodatabase

• feature class = DBMS table• properties

– shape (geometry)• point, multipoint, polylines (include straight, circular arc,

elleptical arc, bezier curve), rings (closed, non-intersecting polylines)

• special column in DBMS

• can be X, Y or X, Y, Z

• both single and multipart geometries can be in same feature class

– e.g. in Arc 7 multiple part polygons were kept in a region class while simple polygons were in a polygon class

Page 19: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Spatial reference

• shapes are stored in Cartesian X and Y (as integers) but with a spatial reference to world system

• converted (as needed) to map units• spatial domain

– max X and Y and min X and Y

• scale– defines how many integers correspond to a map unit– example

• scale = 100 then each value in the coordinate corresponds to one one-hundredth of a map unit.

– in effect scale defines the “precision” of the coordinates that are stored

• scale and domain are inversely related – if difference between max X and min X ( or y) is large than scale is limited– product of the scale and the maximum X (or Y) difference cannot exceed more

than two billion

Page 20: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Subtypes– a little like inheritance but doesn’t require the creation of a

new object class• examples

– building subtypes could be residential, commercial, industrial– highway subtypes could be asphalt, concrete and grave

– why to use subtypes• if you can use subtypes rather than new feature classes you will

improve performance

– when to use subtypes• different groups of related features have distinct custom behaviors

– repair options and periods are different for gravel and asphalt roads

• set of attributes are different– gravel road has gravel size, asphalt road has hot mix type and number of

lanes

Page 21: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Relationships• both spatial and non-spatial

– house is “on” parcel– house “has” owner

• spatial = topological managed by Arc• general relationships created by user

– stored in a relationship table– origination class and destination class

• forward path label• backward path label

– a single object class can participate in one or many relationships• simple relationship

– “peer to peer” between two classes• composite

– “one to many”– composite object from origin class– part object from destination class

– delete origin object and the destination parts are deleted– delete a part or replace with another part is ok– parts can be created independently of composite

Page 22: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Notifications• associated with relationship classes

• used to propagate actions when a “significant” event occurs– like a trigger in older DBMS

• four different notification “directions” or types– no notification

– notification issued to destination object when the origin object is changed

• “pole has been moved - reset location of associated transformer to new coordinates of pole”

– notification is issued to the origin object when the destination object is changed

• “valve has been upgraded in size - total capacity of gas line can be increased”

– notification is issued when either is changed

Page 23: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Attribute constraints

• domains– max or min values

– coded value = selected list (farm, commercial, residential, industrial)

• default values– most common option

• default land use is residential

• essential – to reduce errors in entry

– to insure consistency in reporting

• requires consideration BEFORE data entry begins

Page 24: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Rule validation

• Somewhat like domains • particularly important at object creation

• can take many forms

• rules for both splitting and merging

• examples– when un-improved lot is split divide current value by the

proportion of area of each lot and load into new value and apply current zoning class to new records

– when power_line feature class is connected to building feature class a junction feature of transformer must be inserted

– when merging two lots add the individual valuation for combined valuation

Page 25: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Client - server architecture

• original computer model = mainframes– all powerful, text terminals on desks

• mini-computer and mainframes– some independent smaller computers and mainframe

• PC revolution– everything that could be on machine on desktop

– good - power to people

– bad - duplication of data, lack of synchronization, complicated

• Client - server– mix of PC, “terminals” (sometimes) and server

Page 26: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Client - server in Arc• Arc 8 desktop

– ArcCatalogue, ArcMap, ArcToolbox– familiar Windows look and feel– friendly, interactive

• Arc 8 workstation (actually Arc 7.x)– on server or on local machine (w/ Workstation NT)– major complex operations

• ArcToolbox is a windows front-end to workstation operations– with mouse interact with windows– a set of commands are created and run (possibly) remotely)

• ArcSED– vehicle to connect to spatial data– operates as personal and on “data server”

Page 27: Key object concepts (1 of 2 ) polymorphism –behaviors of an object class can adapt to variations of object Encapsulation –object is accessed only through

Implications of client server architecture

• Good– large data can be on server

• better control

• large horsepower

• less duplication, etc.

– graphic interface easily to design in windows– faster development of capable user– database isolated from application

• Bad– complexity of implementation– increased network requirements– performance issues