When using the top-down development approach to build an assembly diagram, you define the components for your application and then implement them.
Top-down development is used for creating new applications. For this type of development, you first model the application in the assembly diagram by creating components for the required services. Then, you define interfaces to access each service and add them to each component. Finally, based on the service calling requirements, you wire the components together. When the wiring is completed, you generate the SCA implementations from the components in the assembly diagram. The implementations (such as business processes, state machines, and so forth) provide the required services (business logic) for your application
To illustrate the concepts covered in this topic, we will use a simple example of building a brand new customer stock portfolio query application that accesses several new services to retrieve information. The application accepts a customer ID and returns the customer's portfolio information. The application does not use any existing services so we will need to develop implementations for all the services.
Three services are required:
We will also need to allow a JavaServer Pages (non-SCA ) application to invoke the query.
The following picture shows this application:
To simplify our discussion, we will create a single module for the application. All the new services will be added to this module.
This topic provides some general instructions on how you can use the assembly editor to build the integrated application. Detailed step-by-step instructions on how to use tools will not be covered but they are available from the related information at the end of this topic.
Here are the steps:
Create a module
Create a module, StockPortfolio, for the new application. We will assemble services and build the integrated application in its module assembly. All service implementations and resources will be created in the module.
Edit the module assembly
Open the StockPortfolio module assembly with the assembly editor and start to model the integrated application.
Create components
Here is an example of the StockPortfolio assembly diagram with the three new components:
Add interfaces to components
There is also a simpler method to launch the interface editor from the assembly editor and add new interfaces to the components:
For
example, select the CustomerQuery component in the assembly diagram and click
the Add Interface icon, . In the Add Interface window that
is opened, click New... to launch the Interface editor
so that we can create the interface. Once the new interface is created, we
can finish adding it to the component.
However, with this second method, the operations and input/output are not yet defined in the new interface. Later, we have to open the interface (with the interface editor) and add its operations and input/output before generating the implementation for the component. (We do not need the operations and input/output to wire components.)
The interfaces have been added to the components in the following assembly diagram:
Wire components
All the components are wired in the following assembly diagram:
Create component implementations
We need to decide the type of implementation for each component before generating the implementations. Also, the wiring and definitions for all the interfaces should be completed before this step. Select each component and right-click to select Generate Implementation and the required implementation type. The implementation is created and opened in the editor for authoring.
The following assembly diagram shows the three components with generated implementations:
Add stand-alone references
To allow the JSP, which is not an SCA application, to invoke the CustomerQuery service, we will need to create a stand-alone references.
The following assembly diagram has the stand-alone references:
To understand how to package the JSP with the module and write the JSP code, read "Best practices: Modules and packaging for business services" under related reference.
We have finished using the top-down approach to build the new application. If any one of the components in the assembly diagram has to be used outside of the module, then create an export for the component's interface. Here, we have added an export for CustomerQuery component:
Related information