Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Web Applications With J2EE Ohioedge Enterprise Java Solutions Provider Since 1996 By Sandeep Dixit, Partner.

Similar presentations


Presentation on theme: "Building Web Applications With J2EE Ohioedge Enterprise Java Solutions Provider Since 1996 By Sandeep Dixit, Partner."— Presentation transcript:

1 Building Web Applications With J2EE Ohioedge Enterprise Java Solutions Provider Since 1996 By Sandeep Dixit, Partner

2 Assumptions Audience Background Elementary knowledge of J2EE Currently planning or in the process of building Web applications with J2EE

3 Assumptions Audience Expectations Want to learn or verify essential concepts of Web application development with J2EE Want to see live demonstrations of – –sample applications – –deploying sample applications in J2EE-compliant application server – –how a proper implementation of these concepts results in robustness, quality, and improved productivity

4 Today’s Agenda – –Origin of J2EE – –Mindset for building Web applications – –Generalization: J2EE Patterns – –Three-tier component: EJB-JavaBean-JSP – –XML schema-driven applications – –Directory structure: Effective organization of java, jsp, xml, sql and bat script files – –Package structure: Effective grouping of Java and JSP source code – –Live Demonstration of J2eeBuilder Framework & component plug-in

5 J2EE Facts J2EE is not a programming language. J2EE is a specification for writing enterprise applications (distributed computing) J2EE specification compliant code is portable between J2EE-compliant application servers.

6 1985-1992 One programming language for building distributed (client-server) applicationsOne programming language for building distributed (client-server) applications IDE for compilation, debugging, execution and file managementIDE for compilation, debugging, execution and file management Procedural programmingProcedural programming

7 1990+ VB brings client-server (distributed) application development environment to desktopsVB brings client-server (distributed) application development environment to desktops Procedural programmingProcedural programming GUI development is more user-friendlyGUI development is more user-friendly

8 1995+ Java, an OS independent, pure Object- oriented, programming language starts gaining groundJava, an OS independent, pure Object- oriented, programming language starts gaining ground Object-oriented programming is more user friendlyObject-oriented programming is more user friendly Java Remote Method Invocation (RMI) is made available for distributed computingJava Remote Method Invocation (RMI) is made available for distributed computing

9 1997+ Apache Web Server becomes de-facto web serverApache Web Server becomes de-facto web server Java RMI is further strengthened by a specification - J2EE specification - on how to write an RMI server.Java RMI is further strengthened by a specification - J2EE specification - on how to write an RMI server. Developing distributed applications is made more user friendly.Developing distributed applications is made more user friendly.

10 1999+ Servlet/JSP makes HTML-based Web GUI a real thing for enterprise applicationsServlet/JSP makes HTML-based Web GUI a real thing for enterprise applications Object-oriented programming is further extended into XML definition driven object-oriented programmingObject-oriented programming is further extended into XML definition driven object-oriented programming J2EE incorporates XML as the way to specify dataJ2EE incorporates XML as the way to specify data

11 2000+ Enthusiastic software developers start using J2EE.Enthusiastic software developers start using J2EE. Container Managed Persistence becomes a realityContainer Managed Persistence becomes a reality Methodologies for writing J2EE applications are discovered.Methodologies for writing J2EE applications are discovered.

12 2001+ Various articles, papers, and books on J2EE Patterns, Practices, and Strategies are published and presentedVarious articles, papers, and books on J2EE Patterns, Practices, and Strategies are published and presented Jboss an open-source J2EE 1.3-compliant application server is used by more than 1 Million developers world-wideJboss an open-source J2EE 1.3-compliant application server is used by more than 1 Million developers world-wide J2EE is free. J2EE is open. J2EE is here to stay.J2EE is free. J2EE is open. J2EE is here to stay.

13 Mindset for building Web applications Think in terms of “Servicing a request”Think in terms of “Servicing a request” For example, a click on a “create” button on a “customer” page in a browser is a request.For example, a click on a “create” button on a “customer” page in a browser is a request. Building a Web application requires an approach of handling and processing http requests and sending appropriate responses back to the requestersBuilding a Web application requires an approach of handling and processing http requests and sending appropriate responses back to the requesters Application Server CRM

14 Generalization of Services Generalization of how http requests are serviced by presentation-tier, middle-tier, and data-tier results in a generic, inter- tier dependent, reusable library of source code - J2EE patternsGeneralization of how http requests are serviced by presentation-tier, middle-tier, and data-tier results in a generic, inter- tier dependent, reusable library of source code - J2EE patterns

15 Generalization of Services For an example, the application processing “customer-create” request needs to verify if the requester is valid, requester’s session is valid, and license to use application itself is valid. These validation steps are independent of “customer-create” request and are applicable to any requests such as, “customer-delete”, “contact-find”, etc.For an example, the application processing “customer-create” request needs to verify if the requester is valid, requester’s session is valid, and license to use application itself is valid. These validation steps are independent of “customer-create” request and are applicable to any requests such as, “customer-delete”, “contact-find”, etc. This requires that every time a request is received it should be first passed-on to a “generic validation service” that would either permit or deny further servicing of the request.This requires that every time a request is received it should be first passed-on to a “generic validation service” that would either permit or deny further servicing of the request. Typically, validation service would get categorized under “presentation services”. Depending upon the layer where the services are called, they would be categorized under either - presentation, business, or data services.Typically, validation service would get categorized under “presentation services”. Depending upon the layer where the services are called, they would be categorized under either - presentation, business, or data services.

16 Servicing a request Http request originates in a browser Http response ends in the browser URL Presentation-tier Business-tier

17 J2EE Patterns: Presentation-tier Front ControllerFront Controller View HelperView Helper Composite ViewComposite View Service To WorkerService To Worker Dispatcher ViewDispatcher View

18 Brief overview of Presentation-tier patterns Front Controller: Provides a centralized controller for managing the handling of a requestFront Controller: Provides a centralized controller for managing the handling of a request View Helper: Encapsulates logic that is not related to presentation formatting into Helper componentsView Helper: Encapsulates logic that is not related to presentation formatting into Helper components TheViewController *.ctrl

19 Brief overview of Presentation-tier patterns Dispatcher View: Similar to Service To Worker; Dispatcher plays a limited role in the processing of requests - Dispatcher plays limited to moderate role in view management.Dispatcher View: Similar to Service To Worker; Dispatcher plays a limited role in the processing of requests - Dispatcher plays limited to moderate role in view management. –Limited role : No outside resources are utilized in order to choose the view. The information encapsulated in the request is sufficient to determine the view to dispatch the request. For example: http://my.server.com/myContextRoot/Controller?next= login.jsp –Moderate role : The information contains an action to be completed: http://my.server.com/myContextRoot/Controller?action= login The responsibility of the dispatcher component here is to translate the logical name ‘login’ into the resource name of an appropriate view, such as ‘login.jsp’, and dispatch to that view. To accomplish this translation, the dispatcher may access resources such as an XML configuration file that specifies the appropriate view to display. Service To Worker: Combines a Dispatcher component with the Front Controller and View Helper patterns - Dispatcher plays moderate to large role in view management. Dispatcher is more sophisticated. The dispatcher may invoke a business service to determine the appropriate view to display.Service To Worker: Combines a Dispatcher component with the Front Controller and View Helper patterns - Dispatcher plays moderate to large role in view management. Dispatcher is more sophisticated. The dispatcher may invoke a business service to determine the appropriate view to display. –For example: http://my.server.com/myContextRoot/ Customer.ctrl ?submit= Set

20 Service To Worker URL Business-tier

21 Processing the request URL Service Locator Value Object Requests EJB/Business Service Locates Business Service EJB Business Delegate

22 J2EE Patterns: Business-tier Business DelegateBusiness Delegate Value ObjectValue Object Session FaçadeSession Façade Composite EntityComposite Entity Value Object AssemblerValue Object Assembler Value List HandlerValue List Handler Service LocatorService Locator

23 Brief overview of Business-tier patterns Business Delegate: De-couples presentation and service tiers, and provides a façade and proxy interface to the services.Business Delegate: De-couples presentation and service tiers, and provides a façade and proxy interface to the services. Value Object: Facilitates data exchange between EJB and BusinessDelegateValue Object: Facilitates data exchange between EJB and BusinessDelegate Value List Handler: Manages query execution, results caching, and results processing.Value List Handler: Manages query execution, results caching, and results processing. Service Locator: Encapsulates complexity of business service lookup and creation; locates business service factories.Service Locator: Encapsulates complexity of business service lookup and creation; locates business service factories.

24 J2EE Patterns for Servicing Requests Front ControllerFront Controller View HelperView Helper Composite ViewComposite View Service To WorkerService To Worker Dispatcher ViewDispatcher View Business DelegateBusiness Delegate Value ObjectValue Object Session FaçadeSession Façade Composite EntityComposite Entity Value Object AssemblerValue Object Assembler Value List HandlerValue List Handler Service LocatorService Locator Service ActivatorService Activator Data Access ObjectData Access Object Business-tierPresentation-tierData-tier

25 Directory Structure Source CodeSource Code ScriptsScripts J2EE Specification CodeJ2EE Specification Code –ejb.xml –web.xml –application.xml J2EE Application Specific CodeJ2EE Application Specific Code –jboss.xml –jboss-web.xml Java/Jar Specific CodeJava/Jar Specific Code –manifest.mf

26 Package Structure Business Functionality codeBusiness Functionality code –extends framework code Framework codeFramework code –implementation of patterns

27 J2eeBuilder Framework Demonstration of a frameworkDemonstration of a framework –Implementation of patterns –Session Management –User Management –License Management –j2eebuilder-config.xml Demonstration of plugging-in a “product” component into the frameworkDemonstration of plugging-in a “product” component into the framework

28 Summary J2EE is Java, EJB specification, Servlet, JSP, Html, and XMLJ2EE is Java, EJB specification, Servlet, JSP, Html, and XML Use open-source software such JDOM, LOG4J, Apache Web Server, Tomcat Servlet Container, and JBoss Application ServerUse open-source software such JDOM, LOG4J, Apache Web Server, Tomcat Servlet Container, and JBoss Application Server Document your architecture, data-structure, functional scope, directory structure, and package structure, before launching a full- scale developmentDocument your architecture, data-structure, functional scope, directory structure, and package structure, before launching a full- scale development Understand key concepts. Learn to do-it by hand using simple TextPad before using IDEs.Understand key concepts. Learn to do-it by hand using simple TextPad before using IDEs. Keep it J2EE compliant. Avoid getting locked into any vendor specific technology.Keep it J2EE compliant. Avoid getting locked into any vendor specific technology. You build a generic framework and robustness, quality and productivity will come.You build a generic framework and robustness, quality and productivity will come.

29 Q & A


Download ppt "Building Web Applications With J2EE Ohioedge Enterprise Java Solutions Provider Since 1996 By Sandeep Dixit, Partner."

Similar presentations


Ads by Google