• 热门标签

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

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

Java objects are organized in packages, with each package containing ob-jects that logically belong together. A package can also contain sub-packages, forming an hierarchical system. A Java application can e.ortlessly load ob-jects at runtime, either from a prede.ned library location, or from an explic-itly de.ned source. Thus, machine code can be imported into the running assembly from any source, remote or local, or even from code compiled at runtime.

B.2.3 Component Object Model
A Microsoft Dynamic Link Library (DLL) is a .le containing executable code but which has no default entry point. Accessed to a DLL from an executing assembly (EXE or DLL) is obtained by loading the DLL into memory and specifying the address inside the DLL where to start execution. Once the DLL instruction path ends, control is returned to the calling assembly. This corresponds to a C-style function call. A DLL can be loaded when the executing assembly is loaded, static linking, or when the executing assembly calls one of the functions in the DLL, dynamic linking.
A library model which only allows for sharing global C-style functions is an obvious disadvantage in modern object oriented programming. This problem is solved by the Component Object Model (COM). A COM object is a standardized DLL containing four functions. Three of these are for component registration and memory management. The fourth returns an instance of the Class Factory. The Class Factory is an object which manages the objects inside the COM object. Given a unique numeric reference to an object implementation, CLSID, the Class Factory will return an instance of the requested object. Thus, COM is the means to access shared C++ style classes using C-style function calls.
Any COM object is registered in the system registry with a globally unique CLSID, a human readable ProgID, and a reference to the DLL hosting it. An executing assembly uses a system call to load the object corresponding to a given CLSID. The operating system answers this call by loading the DLL speci.ed in the CLSID registry entry, and asking the DLL Class Factory for an instance of the object corresponding to the CLSID.
COM simpli.es memory management by making memory allocation the responsibility of the callee, rather than the caller, which is is the case for C. Although making programming easier, this has a certain performance cost as object instance memory is allocated on the heap rather than the stack. A particularity of COM, compared to Java and .net, is that garbage collection is not managed by the operating system. Consequently, each object must provide its own reference counting and memory deallocation code. This is managed by methods de.ned in a Microsoft de.ned interface, IUnknown, which all COM objects must implement.
As any object can support multiple interfaces, an object-level type cast mechanism is provided through IUnknown. This interface contains a method for fetching a pointer to an interface corresponding to a given interface ID, IID. Microsoft has de.ned a wide range of interfaces ranging from window controls to sound compression codecs. One essential interface is IDispatch. The IDispatch interface de.nes a method accepting an array of strings and pointers as input. This allows for providing an array containing the name of a method, as well the arguments for the method. IDispatch will process the request by calling the C++ method corresponding to the speci.ed name, using the speci.ed argument values.
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:OPTIMIZATION OF FAULT DIAGNOSIS IN HELICOPTER HEALTH AND USA(76)