Dynamic Plug-In Linking, Loading, & Dispatching with Ada 2005
By Pat Rogers, Cyrille Comar
December 8, 2005
(Dynamic Plug-In Linking, Loading and Dispatching with Ada 2005
: Page 1 of 1 )
Modifying an existing application while it executes, without rebuilding from scratch, is a powerful way to enhance and correct large deployed systems such as operating systems. This dynamic extension is relatively straightforward with interpreted languages or virtual-machine based languages such as Java, in which new code is loaded upon demand. In languages typically implemented with static executable images this capability can be offered through DLLs or shared objects, depending on the underlying operating system). However, in practice it is impractical to make full use of this capability because the protocol for invoking subprograms in a shared library is very low-level and error-prone. You simply provide to an operating system routine a string containing the name of the intended function. The operating system routine returns the address of the function which is in turn used to call the function, regardless of whether it accepts the expected number of parameters or returns a value of the expected type.
Object-oriented programming with plug-ins makes this approach practical by using dynamic dispatching to invoke dynamically loaded functionality with a more robust, high-level protocol. In an OO paradigm, a plug-in contains instances of new classes that extend the set of classes in the original application. Calls to routines in the plug-in (represented by a shared library) are done implicitly through dynamic dispatching which is much simpler, transparent to the programmer, typesafe, and more robust.
In this article, we show how a statically-typed, statically-built, object-oriented language such as Ada can make full use of the notion of dynamic plug-ins. To that end, we build an extensible application and illustrate adding new functionality to it at run-time via plug-ins. Selected new features of Ada 2005 are used in the implementation and are highlighted. In particular, we use the "distinguished receiver" syntax familiar to users of C++ and Java. We also use one of the new "containers" data structures packages.
2008 International Mathematica Conference Dr. Dobb's interviews Wolfram Research's Theo Gray, co-founder and Director of User Interfaces, and Roger Germundsson, Director of Research and Development, about the upcoming 2008 International
Mathematica Conference.
How Do You Do Nightly Builds and Tests when there is No Overnight? Software Production in a Geographically Distributed Environment
Attend this Webcast and find out how to overcome common build-test-deploy challenges that affect all members of a distributed team, including:
<ul>
<li> Communication difficulties, because of time-zone and cultural differences</li>
<li> Workflow challenges, like lack of documented procedures and build and test handoff problems</li>
<li> Slow build and test cycles, broken builds, and other factors that hamper distributed team productivity</li>
</ul>
Thursday, September 25, 2005 " 11am PT / 2pm ET
</p>
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.