From: http://hi.baidu.com/murphy1314/blog/item/89635838598f30f6b311c774.html
Several concepts are added:
UML: Unified Modeling Language (UML) is a language used to visually model software-intensive systems. UML is a standard language used to describe, visualize, and document products of object-oriented development systems.
OMD: object model diagrams object model chart.
First, let's take a look at what OMD can do for us?
1. What interfaces does this class support;
2. What objects are required to complete the task;
3. How to Use objects of this class;
4. Can classes be directly instantiated;
5. Methods and attributes of interfaces;
6. Whether other classes support this interface;
7. Relationship between objects
The following figure shows the key of the Object Model graph that runs through this book.
Technorati tags: ArcGIS, OMD
These symbols are created based on UML drawing tools, and UML symbols are industrial Drawing Standards for Object-Oriented Analysis and Design.
The object model graph provides a lot of information, which is an important supplement to the information in the Object Browser. All classes and members are listed in Visual Basic or other development environments, but the relationship between these classes is not specified. Therefore, the object model graph is very helpful for readers to understand the ArcInfo component!
This book uses UML to describe the ArcInfo component, that is, ArcObjects, and describe the data model you can create.
The following is a detailed description.
1. Classes and objects
In the UML diagram, there are three types of classes: abstract class, createable class, And instantiable class ).
Abstract classes cannot be used to create new objects, but can be used to specify subclasses. For example, "line" is an abstract class of "primaryline" and "secondary line.
You can create a class by using the object definition syntax in the development environment. For example, in Visual Basic, dim as new <Object> or Createobject <Object> is written as follows.
The instantiated class cannot directly create new objects, but the objects of this type can be created as attributes of other objects or from methods of other classes. ------ Hard to understand.
2. Join
There are several associations (or links) between an abstract class, a class that can be created, and a class that can be instantiated ).
Association describes the association between classes. You can define the multiplicity Association in the classes at both ends.
In this figure, an owner can own one or more parcels. Similarly, a parcel can be shared by one or more owners.
Multiple associations limit the relationship between object classes and other objects. The symbols used for multiple associations are as follows:
1 -- one and only one. This diversity is optional. If not specified, the default value is "1"
0 .. 1 -- zero or one
M.. n -- from m to n (positive integer)
* Or 0... * -- From zero to any positive integer
1... * -- From any positive integer
Type inheritance defines special classes. They have super class attributes and methods, and also have their own attributes and methods.
It indicates that primary line and secondary line are a type of line.
Instantiation specifies that an object of A Class has such a method. It can create an object of another class.
The pole object has a method to create a transformer object.
Aggregation is an asymmetric association. In this way, the object of the next class is considered as a "whole", and the object of the other class is considered as a "component ".
A transformer bank has exactly three transformer instances. In this figure, transformer can be associated with a transformer bank, but after the transformer bank is removed, transformer can still exist.
Composition is a stronger way of aggregation. In this way, the "whole" object controls the survival time of "partial" objects.
A pole contains one or more crossarm. In this figure, when the pole is removed, crossarm cannot be used any more. Because pole controls the survival time of crossarm.
After installing AE, we can find the AE OMD diagram in the relevant directory,
Generally in the installation directory \ Development Kit \ Diagrams
For OMD in arcengine:
Where
Symbols in OMD:
A triangle symbol represents inheritance
The Black Blocks of diamond form
The front of the dotted line carries an arrow to create
* 1: N
A straight line indicates Union
Category:
Abstract class: it cannot be created or instantiated. It never has an instance of an abstract class.
Defines the public interfaces of sub-classes. sub-classes inherit the interfaces defined by them.
The OMD symbol is a two-dimensional rectangle with a shadow inside.
Instantiation class: it cannot be created and an instance is obtained from another object.
The OMD symbol is: no shadow inside the 3D rectangle.
Class that can be created: use the new keyword to create an object or get a running instance from another object.
The OMD symbol is a shadow 3D rectangle symbol.
Attributes and methods:
Properties: dumbbell-like icon, read (left-side dumbbell) and write (right-side dumbbell)
Method: arrow to the left
Interface: lollipop icon
Connection between charts: Wormhole
======================================
I personally think it is hard to understand in the OMD diagram that the class can be instantiated. I have made the following example to understand it:
In arcengine, workspace is an instantiated class,
The workspace cannot be created with new, but can be created using workspacefarctory. openfromfile () as follows:
Iworkspacefactory pworkspacefactory = new accessworkspacefactoryclass ();
Iworkspace pworkspace = pworkspacefactory. openfromfile (connectionstring, 0 );
But when we try to use new to create a workspace class, it is as follows:
Iworkspace pworkspace = new workspaceclass ();
The following error occurs:
"Type" ESRI. ArcGIS. Geodatabase. workspaceclass does not define constructors;
Therefore, the main difference between class and coclass is that coclass is a class with constructor, so that it can directly create objects using new.