ComponentX Department Example

Overview

The department example was is intended to demonstrate some techniques for using ComponentX to generate an application.. The application is supplied with no user interface components but a user interface could be developed using some of the techniques used in the contacts example. 

Details

The application uses interfaces to contain the main parts of the application. The example also uses the DbCursor component to access the databases it uses. The DbCursor is a database component that provides a cursor style interface to the database, in other words it works with individual records and allows scrolling back and forward through the database. This is different to the datasource component that does not provide this interface style. This application does not make use of the subscriber/publisher combination to route incoming documents to the correct components. It uses combinations of other base components, such as the router component, to route input documents to their destinations. The highest level component of the application is the deptApp component that links together the IO components, the routing components and the processing components. There are three main functions within the application, add an employee, update and employee and query the database. 

Running the example

To run the example first load the project using the open project menu item or tool bar button and choose dept.cxp from the examples\dept directory. To use the application first open the ioServer component and then double click the request and response ports of the serverSocket. Use the file open button in the editor for the request port and load addEmp.xml. Then use the send button to send the document into the application. There now should be a result document <empAdded></empAdded>. There are two other documents that can be submitted to the application which update the record added by the first document. You can perform a simple query by sending <dept/>  to the application which will return a document containing the first department and all the employees assigned to that department. To obtain the next department send <next/> to the application. You can find each department in turn until a no more records result is returned.

There are three sample input XML documents in the example directory that can be used to examine how the application works.

Other information

To learn more about how to load and run applications using ComponentX review the tutorial which can be accessed from the readme.

Copyright 2000,2001 Data Access Technologies