### Building a Stock Quoter with CIAO, CoSMIC, and DAnCE - A Tutorial

###

This tutorial provides a step-by-step lesson on developing component-based distributed applications using CoSMIC modeling toolkit and the 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 is a step-by-step tutorial that will walk you through the development and deployment phases of a CCM application (Stock Quoter). This tutorial assumes that you have read and understood the following articles that describe the example:

· The CORBA Component Model, Part 1: Evolving Towards Component Middleware

· The CORBA Component Model, Part 2: Defining Components with the IDL 3.x Types

· The CORBA Component Model, Part 3: The CCM Container Architecture and Component Implementation Framework

· The CORBA Component Model Part 4: The CORBA Component Model Part 4: Implementing Components with CCM

In addition to the articles above, reading and understanding the resources below will greatly help you follow through this tutorial:

· DAnCE: A QoS-enabled Component Deployment and Conguration Engine

· TAO’s Developer’s Guide Version 1.4a. Chapter 32 : CIAO and CCM.

Prerequisites:
Before you start, you need the following:

· 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.

· Generic Modeling Environment (GME). 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.

· 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 sure you install GME first before you start with CoSMIC toolkits.

Steps for Developing the Stock Quoter Application:

Steps for Developing Stock Quoter Application

Listed below are the steps for developing the Stock Quoter application. Each link is a step-by-step tutorial of the specific step.

1. Define your interfaces and component types:
   1. Define your interfaces using IDL 2.x features, e.g., use the familiar CORBA types (such as struct, sequence, long, Object, interface, raises, etc.) to define your interfaces & exceptions.
   2. Define your component types using IDL 3.x features, e.g., use the new CCM keywords (such as component, provides, uses, publishes, emits, & consumes) to group the IDL 2.x types together to form components.
2. Implement your components, e.g., using C++ or Java & the Component Implementation Definition Language (CIDL), which generates component servants, executor interfaces, associated metadata, & compositions.
3. Package your components, Bundle component implementations with metadata giving their default properties and their component descriptors into component packages.
4. Assemble your components, e.g., group related components together & characterize their metadata that describes the components present in the assembly.
5. Plan your deployment, analyze the runtime resource requirements of assembly descriptors and prepare and deploy required resources where component assemblies can be realized.
6. Deploy your components & run your application, e.g., move the component assembly packages to the appropriate nodes in the distributed system & invoke operations on components to perform the application logic.