Building a Stock Quoter with CoSMIC and DAnCE - A Tutorial

This tutorial provides a step-by-step lesson on developing component-based distributed applications using CoSMIC modeling toolkit and CIAO DAnCE framework. The example application used in this tutorial is a Stock Quoter that consists of two components; the StockDistributor and the StockBroker. The StockDistributor notifies one or more stock brokers whenever a stock price changes. Upon receiving the notification, the StockBroker fetches information about a particular stock from the StockDistributor. The figure bellow shows the application diagram. This Stock Quoter application is based on a series of CORBA component model columns written by Doug Schmidt and Steve Vinoski for C/C++ Users Journal and has consistently been used as an example for TAO.



Stock Quoter application Diagram

This tutorial will show you how to use generic modeling techniques CoSMIC to assist the development process of CIAO applications. All the necessary steps to build a component-based application model via CoSMIC toolkit are documented here.


Note:
1. Although the descriptor files generated by CoSMIC toolkits are portable, the modeling environment required by CoSMIC (GME) only supports MS Windows platforms currently. So this tutorial will focus on Windows users.
2. The CIAO/DAnCE codes used for this tutorial can be found in %CIAO_ROOT%/docs/tutorials/Quoter/Simple.
3. The current tutorial is tested under GME 5.9.21, and  CosMIC 0.4.8. It will be subject to change as version of GME and CoSMIC evolves.

Prerequisite

   Before you start, you need the following:
     1. ACE+TAO+CIAO (Component Integraated ACE ORB)
          ACE + TAO + CIAO provide the CCM infrastructure necessary to enable the CCM-based distributed component interaction. You can click here to download the latest ACE + TAO + CIAO and click here for information on how to build ACE+TAO+CIAO.
      2. GME (Generic Modeling Environment)
          GME is a configurable toolkit for creating domain-specific modeling and program synthesis environments. It provides the execution environment for CoSMIC toolkits. Click here to download GME.
      3. CoSMIC toolkit
           Click here to download the latest CoSMIC release.

Note:
1.Usually you should download the latest GME, but it is possible that CoSMIC hasn't been updated yet to support the very latest GME..The installation process of CoSMIC will tell you which version it is expecting.  So please make sure the GME version you are using is the version required by CoSMIC. A different version of GME may result in undefined errors.
2.Make susre that you install GME first before you start with CoSMIC toolkits.


Getting Started

   This section describes the IDL files used by the example and shows you how to import IDL into PICML (Platform-Independent Component Modeling Language); a domain-specific modeling language which is defined using GME. PICML is designed to help to bridge the gap between design-time verification and model-checking tools and the deployment of component implementations.

Modeling StockQuoter system with PICML

    This section describes how to model the Stock Quoter components in PICML.
    
Implementing Quoter components with DAnCE

    This section provides codes for the Quoter example.

Running the application

   After all the components and descriptors generated by PICML are in place. You are ready to compile and run the application.


Ming Xiong
Last modified: