Step 3: Defining interfaces and implementations

Now you need to define the interfaces and implementations for your application and associate them with the composite diagram:

Defining interfaces and implementations

To define interfaces and implementations for your application:

  1. In the src directory of the Restaurant project create a new package named restaurant with two sub-packages named api and lib.

  2. Define the interfaces of the services in the restaurant.api package:

  3. Define the interface of the Menu (Data Transfer Object):

    package restaurant.api;
    
    import java.io.Serializable;
    
    public interface Menu extends Serializable {
      String printMenu();
    } 
  4. Define the implementations restaurant.lib package.

Associating interfaces and implementations with the diagram

Complete your SCA assembly file with the interfaces and implementations that you defined.

Open the Restaurant.composite_diagram with the SCA Composite Designer.

You have two ways to fill your SCA assembly file:

Now, your SCA assembly diagram looks like:

and, your SCA assembly file looks like:

Right-click on the canvas. The context menu allows you to:

You have finished developing your first SCA application with the SCA Composite Designer. Now you are ready to test the application.