1 / 14

Designing J2EE Applications

Designing J2EE Applications. Objectives. After completing this lesson, you should be able to do the following: Describe the various Java 2, Enterprise Edition (J2EE) patterns Use the Model View Controller (MVC) architecture to design more efficient and maintainable applications

Télécharger la présentation

Designing J2EE Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Designing J2EE Applications

  2. Objectives • After completing this lesson, you should be able to do the following: • Describe the various Java 2, Enterprise Edition (J2EE) patterns • Use the Model View Controller (MVC) architecture to design more efficient and maintainable applications • Identify sample architectures and their merits and demerits

  3. Realizing J2EE Benefits • To leverage the full benefits of J2EE, you must design applications that are: • Portable: You should be able to redeploy the J2EE applications to different servers, databases, and so on. • Scalable: Web applications should be able to handle large numbers of users. • Maintainable: A minimum amount of coding should be necessary for a new business rule. • Reusable: A class that processes credit cards should be reused by multiple applications. • Simple: The business need should be solved with the least amount of complexity.

  4. J2EE Issues • It is important to follow certain guidelines for the design and development of any new technology: • Implement generally accepted design patterns and architectures. • Focus on real business needs rather than simply adopting new technology. • Employ the simplest technology to solve a business problem.

  5. J2EE Design Patterns • Recurring application development issues have led to the acceptance of design patterns. The generally accepted design patterns include (but are not limited to) the following: • Presentation-tier patterns • Intercepting filter • Controller servlet • Business-tier patterns • Business delegate • Transfer object

  6. Implementing Design Patterns by Using MVC • MVC is a framework that separately identifies the components of an application as: • Business functionality (Model) • Presentation (View) • Control logic (Controller) View Controller Model

  7. The Model • The model represents the enterprise data and business rules, handling access and updates. • You can simplify the model by using two mechanisms called “façade class” and “command pattern.” • A façade encapsulates and hides the complexity, and coordinates the operations between cooperating classes. • A command pattern encapsulates each application function in a separate class. • The model is often implemented as EJBs.

  8. The View • The view focuses on presentation and is responsible for maintaining consistency between data presentation and model changes. It enables: • Presentation to be changed without alteringprogramming logic • Development by Web page authors having only visual design skills • The view is commonly implemented as JSPs.

  9. The Controller • The controller provides interaction with the client, serving as a “glue” between the model and the view. • The controller: • Interprets user requests, and controls business objects to fulfill these requests • Removes navigation coding from the view • Can be implemented in the client, Web, or EJB tier or in a combination of these tiers • The controller is usually implemented as a servlet.

  10. MVC in Oracle Application Server 10g Containers for J2EE View Controller Model Selectedview Methodinvocation Returnresult JSP Servlet Enterprise JavaBeans HTTPrequest HTTPresponse Browser

  11. Designing J2EE Applications • Use the following techniques when designing J2EE applications: • Use case analysis: Identify the operations that each component will perform. • Decide how to distribute application functionality across tiers: • A JSP or servlet can access the database by using JDBC, without interfacing with the EJB tier. • Creating EJBs relieves the developer from the task of managing transactions.

  12. Vendor Flow Diagram: Example Receiveorderstatus Customer Administrator Placeorders Log in Fill orders Browseproducts Update inventories

  13. Summary • In this lesson, you should have learned how to: • Consider generally accepted patterns when designing J2EE applications • Identify the model, the view, and the controller components for a J2EE application

  14. Practice 3-1: Overview • This practice covers using J2EE design patterns and the MVC architecture to identify components for a proposed application.

More Related