• 热门标签

当前位置: 主页 > 航空资料 > 机务资料 >

时间:2011-08-28 10:43来源:蓝天飞行翻译 作者:航空
曝光台 注意防骗 网曝天猫店富美金盛家居专营店坑蒙拐骗欺诈消费者

The object oriented approach makes code development tidier, as there is no need to .nd globally unique names for each function. When designing an object to manage a certain task, an important aim is usually to make the external interface to the object as simple as possible, thus concealing the complex inner working of the task. This allows programmers to develop tidy code libraries which are highly reusable.
B.2.1 Interface Programming
The externally accessible functions and variables of an object is referred to as the object interface. An essential part of object oriented programming is the possibility for objects to implement pre-de.ned interfaces. If an object announces that it is implementing an interface, it means that is providing an implementation for all the methods and variables de.ned in the interface.
A typical example of interface programming is database access. All SQL database engines typically provide the same functionality, but has di.erent access protocols. Thus, object models like Java, ActiveX and .net provide a hierarchy of interfaces representing the standard database objects such as connection, command and result set. The database providers then pro-vide implementations for their speci.c protocols using these standard inter-faces. Consequently, a client application can relate only to the standard
B.2. OBJECT ORIENTED PROGRAMMING
interfaces, without any knowledge about the underlying database speci.c protocols. This means that the same client code can interact with several di.erent database engines by simply loading the interface implementations corresponding to the desired database engine dynamically at runtime.
Interface programming is a powerful tool allowing application functional-ity to be split in layers, where each layer can have multiple implementations. Reusable objects such as database drivers and multimedia codecs can then be shared between applications. Further, a given application can seamlessly switch between several implementations of a given interface hierarchy, for instance to support multiple video formats, without any speci.c code to ac-commodate each implementation.


B.2.2 Java
Java is a high level programming language developed by Sun Microsystems. A Java application does not run directly on the operating system, but on a Java Virtual Machine (VM). The VM is a kind of operating system inside the operating system, and exists for most operating systems and hardware platforms. Thus, the VM acts as an abstraction layer, making the underlying platform transparent. This makes Java applications highly portable, as the same compiled code will run on almost any platform.
The VM is responsible for resource allocation, including memory alloca-tion and deallocation. Object instance memory is typically allocated on the heap, allowing methods to return object instances by reference. The VM is also responsible for counting the references to each object instance. Once the reference count to an object drops to zero, the object instance memory is automatically released.
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:OPTIMIZATION OF FAULT DIAGNOSIS IN HELICOPTER HEALTH AND USA(75)