Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document presents iPOJO's structural service composition concepts and a simple example to illustrate them.

...

Motivation

Component composition occurs in two fashions:

...

A service contained in a composite is a sub-service, which is isomorphic to sub-components in traditional component-oriented composites. A sub-service is a service instance created from a component factory. Sub-services are not visible outside of the composite and can only see other services that reside in the composite service registry. The set of services in the composite service registry are all sub-services as well as all imported services. Sub-services are not aware of the fact that they are inside of a composite and provide and use services normally within their composite.

"Hello World"

...

Composite

This section describes a simple composition example importing several services, instantiating composite example that imports an aggregated set of services from the parent composite, contains 3 sub-services, and exporting provides one service to the parent composite.

The

...

"Killer" Application

To illustrate the composition composite we will design a "Hello World" application named HelloComposition. This application offers a service for writing a "Hello" message for each imported Personto each person listed in a Directory service. Each person is published as a service and is used by the composition to get the name of the person in order to write the message.

The application composite provides the HelloDispatcher service:

Code Block
public interface HelloDispatcher {
              public void dispatch();
	      public String getLanguage();
	    public List<Person> public List<Person>getPersonsgetPersons();
}

Application Design

To implement this application, we can reuse existing service implementation. Indeed, we have on the shelf 3 "instantiable" services.

...