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.
- 5 Rules for Immediate Annuities
- Death in the Family: 12 Things to Do Now
- Dumbest Things You Do With Your Money
- 6 Online Networking Mistakes to Avoid
- 401(k) Mistakes to Avoid
- 5 Economic Scenarios to Keep You Up at Night
- The Real ‘Best Places to Retire’
- Best Credit Cards for You
- 12 Tough Questions to Ask Your Parents
- The Real ‘Best Colleges’
- Home Buyer Tax Credit: How to Cash In
- Why You Shouldn't Bash Cash
- 8 Phony 'Bargains' and Better Alternatives
- Danger: 3 Debit Card Scams to Avoid
- 6 Myths About Gas Mileage
- 29 Fees We Hate Most
- Quick and Easy Ways to Boost Returns
- Best Stocks to Buy Now
- Lower Your Taxes: 10 Moves to Make Now
- New Jobs: 8 Lessons from Real-Life Career Switchers
- The New Job Market: Who Wins and Who Loses?
- Health Care Reform's Public Option: Everything You Need to Know
- Volunteer Work When Unemployed: Should You Work for Free?
- Whose Recovery Is This?
- Long-Term-Care Insurance: 4 Biggest Risks to Avoid
Content provided in partnership with
Most Recent Technology Articles
Most Recent Technology Publications
Most Popular Technology Articles
- BizRate to monitor in-store customer satisfaction for Office Depot stores - Market Intelligence
- Speed control of separately excited DC motor
- Effects of creative, educational drama activities on developing oral skills in primary school children
- Political stability and economic growth in Asia
- Failed businesses in Japan: a study of how different companies have failed, and tips on how to succeed, in the Japanese market



