OLE Automation
In Microsoft Windows applications programming, OLE Automation (later renamed to simply Automation[1][2]) is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate (i.e. set properties of or call methods on) shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another.[3] As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server". Contrary to its name, automation objects do not necessarily use Microsoft OLE, although some Automation objects can be used in OLE environments. The confusion has its roots in Microsoft's earlier definition of OLE, which was previously more or less a synonym of COM. Advantages and limitationsTo ensure interoperability, automation interfaces are limited to use a subset of all COM types.[4][5] Specifically, automation interfaces must use SAFEARRAY instead of raw COM arrays. Automation-compatible COM servers can, however, rely on the in-built OLE marshalling implementation.[6] This avoids the need for additional proxy/stub projects for marshalling out-of-process. DisadvantagesFor some users, using it introduces undue complexity and is simply for the self flagellation of the OOP paradigm.[citation needed] Also there are security risk because it is limitless and some may misuse it.[7] UsageAutomation was designed with the ease of scripting in mind, so controllers often provide languages such as Visual Basic for Applications to end users, allowing them to control automation objects via scripts. Automation objects are often written in conventional languages such as C++,[8] where C++ attributes can be used to simplify development,[9] Languages such as Visual Basic and Borland Delphi also provides a convenient syntax for Automation which hides the complexity of the underlying implementation. Type librariesIn order to automate an application, the developer of an automation controller must know the object model that is employed by the target application exporting activation objects.[10] This requires that the developer of the target application publicly document its object model. Development of automation controllers without knowledge of the target application's object model is "difficult to impossible".[11]
Due to these complications, Automation components are usually provided with type libraries, which contain metadata about classes, interfaces and other features exposed by an object library. Interfaces are described in Microsoft Interface Definition Language. Type libraries can be viewed using various tools, such as the Microsoft OLE/COM Object Viewer ( Microsoft has publicly documented the object model of all of the applications in Microsoft Office,[16] and some other software developers have also documented the object models of their applications. Object models are presented to automation controllers as type libraries, with their interfaces described in ODL. Language supportAutomation is available for a variety of languages, including, but not limited to:
See alsoReferences
Further reading
External links
|