Discuss this tutorial. Printable version (PDF).
Go to Contents page. Go to previous page. Go up a level. Go to next page.

 

 

Design


When you create databound web applications using the Struts and BC4J frameworks, you gain these benefits over BC4J web applications without Struts:

  • All the benefits of the MVC approach to flow control that Struts supports. For example, MVC model 2 allows Web application developers to cleanly separate the display code (for example, HTML and tag libraries) from the action-handling code (Java and JSP scriplets). As a result, Web applications based on the Struts framework are easier to both read and maintain.

  • Struts uses a single .xml file to define the application module binding information that would otherwise appear inside each BC4J JSP page of a project.

  • Struts handles the Business Component events as prebuilt action classes that the Struts ServletController executes at runtime. This eliminates the need to include event handling code in each BC4J JSP page (such as is provided by the <jbo:DataHandler> component tag or the <jbo:OnEvent> tag).

  • Struts uses a single, easy to localize .properties file to consolidate message strings that would otherwise appear inside each BC4J JSP page of a project.

While it is possible to develop Web applications that do not follow the MVC paradigm, in general the Struts framework provides significant advantages to the developer:

  • Struts makes it possible for JSP pages to externalize flow control. Rather than specify physical links to various JSP pages within the JSP file, the JSP file contains a Struts-defined logical URI. The Struts URI defines a logical page request mapped to actions that may return different physical JSP pages depending on the context of the HTTP request.

  • Struts simplifies the development of the actual JSP file content by limiting it to user interface generation only. Java that would otherwise appear inside the JSP files appears in separate servlet action classes that the JSP page invokes at runtime.

  • Struts helps to separate the development roles into user interface designer (HTML or tag library user) and JSP action-handler developer. For example, one person can write JSP page using only HTML or suitable tag libraries, while another person works independently to create the page action handling classes in Java.

  • Struts externalizes JSP actions that would otherwise appear inside all the JSP pages of your project into a single configuration file. This greatly simplifies debugging and promotes reuse.

  • Struts consolidates String resources that would otherwise appear inside all the JSP pages of your project (for example, form labels) into a single file. This greatly simplifies the task of localizing JSP applications.

The figure below (created with JDeveloper) shows some of the key classes in the BC4J-VSM end-user interface. To display the complete class diagram, click here.

Key user classes.

Other apects of the BC4J-VSM design are covered in various lessons in this tutorial series.


Discuss this tutorial. Printable version (PDF).
Go to Contents page. Go to previous page. Go up a level. Go to next page.
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy