If an IBM® Rational® Rhapsody® model has global instances, as in the case of singletons, something must call their init() function. In C++, the problem is solved using default construction. In C, however, another mechanism must be found. In the case of executable components, the main() function can call the initializers of global objects. But with library components, the user of the library must call the initializer before using a global object.
In IBM Rational Rhapsody Developer for C, the component initializer calls the init() operations for all packages in the component scope. In turn, the package initializer calls the init() operations generated for any global objects, events, and so on, within the package scope.