[ArcGIS]ArcGIS开发系列-1

  • 格式:doc
  • 大小:428.50 KB
  • 文档页数:15

[ArcGIS]ArcGIS开发系列-1推出ArcGIS开发系列,面向开发,当然要求用户层次稍微高一些。

第一部分 - COM第二部分 - Object model diagrams第三部分 - Map and layers(暂定,入门用)具体特点如下:-基于ArcGIS-ArcObjects,面向开发初级,高级编程的必经之路-使用ArcGIS-VBA-采用英文和中文结合,重点翻译1 COM: Component Object Model内容提要:-Working with COM classesInterfacesPolymorphism(多态性)QueryInterface详细解释:-COM: Component Object Mode-l组建对象模型COM is a protocol that connects one software component, or module, with another . With this protocol, it is possible to build reusable software components that can be dynamically interchanged in a distributed system.-InterfacesAll ArcMap and ArcCatalog (ArcInfo) classes are COM classes. COM classes use in terfaces to organize properties and methods. Classes may have many interfaces. 可以理解为一组有功能关系的properties and methods的结合,对外是一个Interface-QueryInterfaceCOM objects use COM interfaces to communicate with each other. When working wit h COM objects, the developer never works with the COM object directly, but via one of its interfaces.从一个Interface转到另一个Interface,称作QueryInterface,和指针的概念相似?-PolymorphismClasses can share the same interface but have unique implementation.如果理解了Class和Object的概念,这个不会太困难。

An object is an instance of a class。

山不在高,有仙则明;水不在深,有龙则灵。

2 Introducing COM-简介内容提要:-COM is a standard for creating classes是用于创建类的标准-Classes can be reused between applications类可以在应用程序间重复使用--Independent of programming language和编程语言无关,即独立于编程语言-All ArcObjects are COM classes所有ArcObjects都是COM的类-Technologies based on COM基于COM的技术如下--Object Linking and Embedding (OLE)--OLE DB--ActiveX is any technology built on COM--DCOM and COM+详细解释:COM is a standard that specifies how classes should be programmed, not a langua ge. COM is a binary specification that establishes a common method of building software components.COM 是指定类如何编程设计的一个标准,不是程序设计的语言。

是一个能够建立软件组件的一种通用的二进制规范。

ReuseCOM allows components to be reused at a binary level, meaning third party devel opers do not require access to source code, header files, or object libraries i n order to extend the system, even at the lowest level.COM允许以二进制方式component的重用,这样第三方开发者可以在不要源码、头文件或者目标库的条件下扩展系统。

3 COM classes的interfaces内容提要:-Objects可以有一个或者多个interfaces-Interfaces定义了一组方法methods和属性properties-通过an interface和an object进行通信详细解释:COM interfacesDeveloping with COM means developing using interfaces. All communication betwee n COM components happens via the components’ interfaces.利用COM进行开发意味着利用interfaces开发。

COM components间的通信都是利用components的interfaces。

Interfaces are standardized by COM rules, so it does not matter what language i s used to create a class. Interfaces help a class evolve over time because newinterfaces can be added.Interfaces以COM规则作为标准,所以用什么语言创建一个class都行。

Interfaces帮助class岁时间变化的扩展,因为可以增添新的interfaces。

However, once an interface is added, it can never be removed. The actual implem entation can be altered (e.g., an algorithm can be updated without breaking any third party developer code), but the interface is permanent.但是,一旦一个interface加入,她就不能被删除掉。

其实际的实现可以更改,例如,其算法可以在不破坏第三方开发代码的情况下更新,但interface是永久的。

Why interfaces?Some object-oriented programming languages use only classes and objects without interfaces. Problems can arise when a class needs to be updated and code chang es.一些OOP程序设计语言仅仅用到classes和objects,而不用interfaces。

当需要升级和代码变更时,问题就会发生。

As the class and its code evolve, client code could become obsolete, and any cl ient code using the class (instantiating it and using its properties and method s) may be caused to fail.当class和她的代码变化时,其客户端的代码就会变得旧了,任何利用该class的客户端的代码就有可能导致不能运行。

For example, imagine a car dealer installing the latest stereo in your car. The new stereo has an AM/FM radio and a CD player. But what if you own cassettes, not CDs?例如,如果一个轿车销售商想在你的车上安装最新型的立体声音响,新型立体声音响有一个AM/FM收音机和一个CD。

但如果你想要磁带,而不是CD,这时怎么办呢?Programming with interfaces would allow the dealer to install the new CD interf ace without changing or removing the cassette interface.利用interfaces程序设计就可以让销售商安装新的CD的interface,而不改变或者移走你的磁带的interface。

Interfaces solve this problem of evolving code. Once written, code for an inter face never changes; therefore, client code is less likely to break.Interfaces解决了代码升级的问题。

一旦写入,编写interface的代码就不会再变化,所以,客户端的代码就不容易崩溃。

The client code can assume an interface will never change. If the class needs t o be reprogrammed, new interfaces are created. The class evolves without causin g headaches for the existing client code.客户端的代码可以假定interface永远不变。

如果class需要重新程序设计,新的interfaces创建。

这样,class的变化升级不会导致已经存在的客户端的代码发生问题。