Articles Forum Examples Download Open Source
Copyright(c) 2006 by Pocomatic Software. All rights reserved.
This example was originated from an OMG's tutorial designed for CORBA Component Model (CCM). It models a GPS instrument consists of the following three components implemented as Plain Old C++ objects (POCO) and wired together, as illustrated in the diagram below:
a tick pulse generator, implemented as TickGenImpl, generates clock pulses for the instrument,
a GPS location device, implemented as GPSLocatorImpl, locates the instruments current location and notifies subscribed displays on position update.
a display device, implemented as NavDisplayImpl, retrieves location data from GPS and display them.

These
three components (beans) are instantiated, configured and wired up
inside a PocoCapsule/C++ IoC container using PocoCapsule/C++ IoC core
schema description setup.xml. The same
example using a more express domain-specific-modeling (DSM) schema
can be found in the ${POCOCAPSULE_DIR}/examples/corba/dsl-gps
directory.
main.C: This is a simple container used to assemble the GPS application. Notably, this container itself is completely decoupled from application bean implementations. It does not include/use their source code or link with their binaries.
Interfaces.h: C++ interfaces (as pure virtual C++ classes) definitions of component beans. Note: an equivalent CORBA version of this example, that uses IDL to define component interfaces, can be found in the ${POCOCAPSULE_DIR}/examples/corba/gps directory.
TickGenImpl.h and TickGenImpl.C: The implementation of tick generator device bean class.
GPSLocatorImpl.h and GPSLocatorImpl.C: The implementation of GPS locator device bean class.
NavDisplayImpl.h and NavDisplayImpl.C: The implementation of Navigate Display device bean class. It is also notable that above three application implementation POCO beans themselves are container agnostic. It does not use, nor link with PocoCapsule/C++ container runtime engine. They are plain old C++ objects can be developed and tested completely independent of and unaware of PocoCapsule/C++ container.
setup.xml: The application context setup descriptor that describes the configuration and wiring of the modeled GPS application.
To build this example, the environment variable POCOCAPSULE_DIR should point to the PocoCapsule/C++ installed directory. Then, this example can be built by simply invoking gmake/make on linux/unix or nmake on windows.
· Before starting the application deployment container (i.e. the main executable), make sure the LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows) environment variable is set correctly to include the ${POCOCAPSULE_DIR}/lib directory.
· start the main executable:
prompt> main
It will display GPS locations ...