Presentation is loading. Please wait.

Presentation is loading. Please wait.

3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.

Similar presentations


Presentation on theme: "3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications."— Presentation transcript:

1 3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications

2 3-2 Copyright © 2005, Oracle. All rights reserved. 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 3-3 Copyright © 2005, Oracle. All rights reserved. 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 3-4 Copyright © 2005, Oracle. All rights reserved. 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 3-5 Copyright © 2005, Oracle. All rights reserved. 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 3-6 Copyright © 2005, Oracle. All rights reserved. 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 3-7 Copyright © 2005, Oracle. All rights reserved. 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 3-8 Copyright © 2005, Oracle. All rights reserved. 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 altering programming logic –Development by Web page authors having only visual design skills The view is commonly implemented as JSPs.

9 3-9 Copyright © 2005, Oracle. All rights reserved. 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 3-10 Copyright © 2005, Oracle. All rights reserved. MVC in Oracle Application Server 10g Containers for J2EE Browser Servlet Enterprise JavaBeans HTTP response Method invocation Return result Selected view ModelViewController JSP HTTP request

11 3-11 Copyright © 2005, Oracle. All rights reserved. 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 3-12 Copyright © 2005, Oracle. All rights reserved. Flow Diagram: Example Browse products Receive order status Administrator Vendor Log in Customer Update inventories Fill orders Place orders

13 3-13 Copyright © 2005, Oracle. All rights reserved. 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 3-14 Copyright © 2005, Oracle. All rights reserved. Practice 3-1: Overview This practice covers using J2EE design patterns and the MVC architecture to identify components for a proposed application.

15 3-15 Copyright © 2005, Oracle. All rights reserved.

16 3-16 Copyright © 2005, Oracle. All rights reserved.


Download ppt "3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications."

Similar presentations


Ads by Google