• 検索結果がありません。

Servlets with JavaBeans Implementation of Tree Architecture

Consider a component of tree architecture and its JavaBeans implementation, i.e. the interface bean and the function bean for the component. As we discussed in Section 10.1, the roles of the interface bean are:

1. the user interface of the component, 2. the sender of press events, and 3. the receiver of obs events.

We can implement the roles by using a Servlet. We call the Servlet interface servlet.

By replacing the interface bean withthe interface servlet, we get another implementation of the component.

Chapter 11

Support Tools

We developed support tools of CBDL.

Firstly, we developed a support tool of CBDL using LFMB1. The input of the tool is projection-style behavioral specifications written by using CafeOBJ and components that are JavaBeans. The tool stores components in the inner component library, verifies refinement, generates connectors whose correctness is guaranteed by the refinement ver-ification and which are JavaBeans, and generates component-software by combining the connectors and components of the component library.

Then, we developed support tools of CBDL using LFMB and LFME2. Based on the research of the above tool, we design the tool. The tools are a support tool for stand-alone type component-based software (abb. the tool for SA) and a support tool for client-server type component-based software (abb. the tool for CS). In the tool for SA, components and connectors are JavaBeans. In the tool for CS, components and connectors are Servlets and JavaBeans. The input of the tools are (1) UML diagrams with OCL descriptions whose forms are XML files and (2) components. The tools store components in the inner component library, verify consistency of the UML diagrams, generate connectors whose correctness is guaranteed by the verification, and generate component-software by combining the connectors and components of the component library.

11.1 A Support Tool of CBDL using LFMB

The input of the tool is (a) a requirement specification of target software, (b) a refined specification specifying how to combine components, and (c) components (Fig. 11.1). (a) and (b) are projection-style behavioral specifications written by using CafeOBJ . (c) is JavaBeans. The output of the tool is JavaBeans that is obtained by combining (c) and generated connectors (Fig. 11.1). The tool guarantees high reliability of the output by verifying refinement and generating the connectors.

1The tool was developed in the project “A Highly Reliable Java Code Generator Using Component Specifications”.

2The tool was developed in the project “A Management System of Component-based Software Using Internet”.

A requirement specification A refined specification

Components

The support tool

Target software

Figure 11.1: Input and output of the support tool

Refinement verifier

Connector generator

Interface generator

Software generator

Figure 11.2: The structure of the sup-port tool

Figure 11.3: An outlook of the support tool

11.1.1 The structure of the support tool

The tool is constructed from refinement verifier, connector generator, interface generator, and software generator (Fig. 11.2).

Refinement verifier generates verification scripts and then, sends those scripts to CafeOBJverification system and gets the results.

Connector generatorgenerates the function bean of the composite component by using the method discussed in Section 10.2.

Interface generator generates the interface bean of the composite component by using the method discussed in Section 10.2.

Software generator generates the target software by combining (1) the function bean and the interface bean of the composite component and (2) the function beans of the constructing components.

11.1.2 The functions of the support tool

Fig. 11.3 is an outlook of the support tool. When the tool starts, the textarea shows parameters of the tool, like TmpDir and SpecDir (Fig. 11.3).

TmpDir directory is the directory in which JavaBeans are stored. So, in TmpDir directory, components of the component library are stored. Moreover, the output of the tool is stored in TmpDir directory.

SpecDir directory is the directory in which CafeOBJ specifications are stored. So, component specifications and connector specifications are selected from these CafeOBJ specifications.

When Add Spec button is pressed, a dialog is displayed. By using this dialog, nent specifications and connector specifications are selected. At the first time, a compo-nent specification is selected as a requirement specification. At the second time and after, a connector specification is selected as a refined specification and refinement verification is executed. If refinement verification fails, the textarea shows unsatisfied equations.

When the textarea shows unsatisfied equations, Add Spec button is changed to Eq Verify button. When Eq Verify button is pressed, the tool enters manual verification mode for an unsatisfied equation. After writing a verification script for the unsatisfied equation on the textarea and then pressing Verify button, refinement verifier executes verification whether this script succeeds. By iterating this process for all the unsatisfied equations, the tool executes refinement verification. When all the unsatisfied equations are verified,Eq Verifybutton is changed toAdd Specbutton. By using manual verification mode, we found the idea of the automated refinement verification.

Constructing components of composite components may be composite components.

This means composite components may have hierarchical structures. The tool supports stepwise refinement to deal with the hierarchical structures. A component specification imported to a connector specification may have a corresponding connector specification.

The process of stepwise refinement is as follows: In a stage, the former connector specifi-cation is input and refinement verifispecifi-cation is executed by using Add Spec button. In the next stage, the latter connector specification is input and refinement verification between the component specification and the latter connector specification is executed by using Add Specbutton.

When Add Comp button is pressed, a dialog is displayed. By using this dialog, the correspondences between (1) the component specifications input by using the dialog of Add Spec button and (2) components in the component library are input. The software generator uses these correspondences.

When Gene Comp button is pressed, the connector generator and the interface gen-erator generate the function beans and the interface beans, respectively.

When Gene App button is pressed, the software generator generates the target soft-ware.

If Chg Data Comp button is pressed before Gene Comp button is pressed, a dialog is displayed. By using this dialog, input and output interfaces and obs event process routines are changed as we discussed in Section 10.2.