Model-driven development of large-scale Web applications

IBM Journal of Research and Development, Sep-Nov 2004 by Tai, H, Mitsui, K, Nerome, T, Abe, M, Et al

1. A JSP file from a page in the model.

2. An action class from an action invocation in the model.

3. A bean class from the page data in the model.

For example, a skeletal JSP file contains a title, a description, static hyperlinks, HTML forms to invoke actions, and page data (output items).

One typical problem related to the code generator is how to update the generated code as the model changes. Regarding action class generators and bean class generators, we solved this problem by generating abstract classes that are to be extended by developers. Each time the model is changed, the tool generates the abstract classes. Developers are notified-in the form of compile errors-of the need to modify the implementation classes when they recompile the implementation classes.

Figure 11 shows a class hierarchy of the classes related to a generated class of a Struts application. The Action class and the ActionForm class are provided by Struts. LogonAction and LogonForm are the abstract classes generated by the code generator. LogonActionImpl and LogonFormImpl are the classes that are implemented by developers. The generated LogonAction class contains the constant fields of the result codes, and the definition of the execute method and the declaration of an abstract method named perform, which is introduced by the generator. If we change the name of the result code from OK to SUCCESS, the constant field, RC_OK, is replaced by RC_SUCCESS; the references to RC_OK then cause compile errors (references to an unknown field). It is not difficult for developers to modify such source code.

Configuration file generator

For Struts, developers must prepare a configuration file, named struts-config.xml, in which the page flows are described and other information is given. Although this method is better than embedding page flow information in various blocks of program code, it is still difficult to keep the configuration file correct. Our tool prototype can generate a complete set of page flow descriptions from a valid model.

Stub code generator

Our tool prototype generates stub code for pages and actions. Each developer can construct an executable Web application (partially implemented Web application) that is a mixture of completed artifacts and generated stub code. Action stub code checks incoming requests and reports any inconsistency in the requesting page (JSP) built with the WAD model. Figure 12 shows a dialog window where an automatically generated stub action pops up and reports an error in the requesting page. Screen designers can test whether or not a JSP can be executed, then whether or not the response is correct, and finally whether or not the JSP sends out the correct request for the subsequent action. In Figure 3, to the left of the model, these checks correspond to the arrow labeled "Verify" that is drawn between the model and the realized page.

As described in section 4, Web application development involves two problems: the wide range of technologies and a lack of support for the division of work. To tackle the variety of technologies, we defined a set of roles and their activities as described in section 5. In this case, it is important to localize the varieties of required technologies for each role. The MVC pattern or the Model 2 architecture makes it easy to divide the total work into tasks for each development role (screen designer, business logic programmer, or server object programmer). However, the MVC pattern or Model 2 architecture cannot help us maintain consistency among the artifacts created by each type of developer. To maintain consistency, developers require the specification of the application they are going to develop. Our metamodel provides a way to explicitly describe the basic portion of the specification. In addition, the tool prototype assists developers with their tasks by providing various generators and the means to check the conformity to the model.


 

BNET TalkbackShare your ideas and expertise on this topic

Please add your comment:

  1. You are currently: a Guest |
  2.  

Basic HTML tags that work in comments are: bold (<b></b>), italic (<i></i>), underline (<u></u>), and hyperlink (<a href></a)

advertisement
advertisement
  • Click Here
  • Click Here
  • Click Here
advertisement
Click Here

Content provided in partnership with ProQuest