The main idea of software components is that your software is not one single piece of code, but as many components as concerns of your software. One component has one concern of your business, this why we talk about business code.
In this example, the Ticket Office wishes to communicate with an Airline Company. For that we declare that the component "TicketOffice" is connected to the component "AirlineCompany".
The role of the ticket office is to take order from clients, like a reservation. The role of the airline company is to sell free places.
Components will send message in destination to another component: an order, a response, a transation, etc.
The message is very like a mail in the physical and the virtual world.
The communications are asynchronous.
A component is structured like this:
The business code is embedded in a facade, which is in a container. The container is in charge of the communication and the connection with other containers.
Each container has a thread, which reads a FIFO of received messages. The thread invokes the appropriate business code through the facade.
SmartTools enhances OSGi by enabling multiple instanciation of a component.
As a developer, you define a type of component, SmartTools will instantiate a component of this type.
To connect 2 components, you say (connectTo id_src=A-1 type_dest=B id_dest=B-1).
If B-1 doen't exist yet, SmartTools will start it for you, without you have to order (startComponent type=B id=B-1).
Every type of component has a description (like SCA) that defines the outputs and inputs services.
The wires between output and input services are evaluated and created with components' descriptions (unlike SCA).
You can send a message to more than one component.
You can receive a message from more than one component.
OSGi is a popular modules platform.
A SmartTools type of component is define in one OSGi bundle.
The type and each component are registered in OSGi as services. (symbol stars)
The bundle must be started (green triangle) so that it defines the SmartTools component.
It is a component defined in SmartTools that connects components each other.
All components are connected to the Components Manager and can order it to connect to another component.
Components Manager is splitted in different modules: first is local DS (Directory Service), then comes remote DS (Discovery Service) (see next section).
Local DS knows every local components' types and instances.
Local DS knows how to connect local components only.
The Components Manager starts with a World configuration and initializes then the environment with this World DSL.
The two pictures illustrate an example of some components initialized and connected with a World file. The graph shows us what components are started and how the components are connected each other.
This is how SmartTools is activated on a RCP (same as Eclipse):
Last modified: $Date: 2008-09-02 15:56:02 +0200 (Mar, 02 sep 2008) $