Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to j2 ee frameworks


Published on

Introduction to J2EE framework . Gives the primary knowledge about the framework involves in J2EE based web development . This is like Struts , Hibernate , spring ,JSF etc.

Published in: Software
  • Login to see the comments

Introduction to j2 ee frameworks

  1. 1. Introduction To J2EE Frameworks Presenter Mukesh Jha Email-
  2. 2. What is Software Framework A software framework is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate development of software applications, products and solutions.
  3. 3. J2EE Frameworks 1. Struts 1.0 and 2.x 2. Hibernate 3.0 3. Spring 3.1 4. JSF 2.0
  4. 4. MVC Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts: Model - The lowest level of the pattern which is responsible for maintaining data. View - This is responsible for displaying all or a portion of the data to the user. Controller - Software Code that controls the interactions between the Model and View. MVC is popular as it isolates the application logic from the user interface layer and supports separation of concerns. Here the Controller receives all requests for the application and then works with the Model to prepare any data needed by the View. The View then uses the data prepared by the Controller to generate a final presentable response. The MVC abstraction can be graphically represented as follows.
  5. 5. Struts 2. 1. Based On MVC 2 architecture .
  6. 6. Struts 2 Features 1. POJO forms and POJO actions - Struts2 has done away with the Action Forms that were an integral part of the Struts framework. With Struts2, you can use any POJO to receive the form input. Similarly, you can now see any POJO as an Action class. 2. Tag support - Struts2 has improved the form tags and the new tags allow the developers to write less code. 3.AJAX support - Struts2 has recognised the take over by Web2.0 technologies, and has integrated AJAX support into the product by creating AJAX tags, that function very similar to the standard Struts2 tags. 4 .Easy Integration - Integration with other frameworks like Spring, Tiles and SiteMesh is now easier with a variety of integration available with Struts2. 5. Template Support - Support for generating views using templates. 6. Plugin Support - The core Struts2 behaviour can be enhanced and augmented by the use of plugins. A number of plugins are available for Struts2. 7. Profiling - Struts2 offers integrated profiling to debug and profile the application. In addition to this, Struts also offers integrated debugging with the help of built in debugging tools. 8.Easy to modify tags - Tag markups in Struts2 can be tweaked using Freemarker templates. This does not require JSP or java knowledge. Basic HTML, XML and CSS knowledge is enough to modify the tags. 9.Promote less configuration - Struts2 promotes less configuration with the help of using default values for various settings. You don't have to configure something unless it deviates from the default settings set by Struts2. 10.View Technologies: - Struts2 has a great support for multiple view options (JSP, Freemarker, Velocity and XSLT)
  7. 7. Hibernate 1)Hibernate is an Object-Relational Mapping(ORM) solution for JAVA and it raised as an open source persistent framework created by Gavin King in 2001. It is a powerful, high performance Object-Relational Persistence and Query service for any Java Application. 2 )Hibernate maps Java classes to database tables and from Java data types to SQL data types and relieve the developer from 95% of common data persistence related programming tasks.
  8. 8. Hibernate Advantage • Hibernate takes care of mapping Java classes to database tables using XML files and without writing any line of code. • Provides simple APIs for storing and retrieving Java objects directly to and from the database. • If there is change in Database or in any table then the only need to change XML file properties. • Abstract away the unfamiliar SQL types and provide us to work around familiar Java Objects. • Hibernate does not require an application server to operate. • Manipulates Complex associations of objects of your database. • Minimize database access with smart fetching strategies. • Provides Simple querying of data.
  9. 9. Hibernate Architecture
  10. 10. Key Component Of Hibernate • Configuration Object • Session Factory Object • Session Object • Transaction Object • Query Object • Criteria Object
  11. 11. Spring Framework • Spring framework is an open source Java platform and it was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003. • The core features of the Spring Framework can be used in developing any Java application, but there are extensions for building web applications on top of the Java EE platform. Spring framework targets to make J2EE development easier to use and promote good programming practice by enabling a POJO-based programming model
  12. 12. Spring Architecture
  13. 13. Spring Framework key components • The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application’s configuration and dependency specification from the actual application code. • Spring context: The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality. • Spring AOP: The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transactionmanagement into your applications without relying on EJB components. • Spring DAO: The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO’s JDBC-oriented exceptions comply to its generic DAO exception hierarchy. • Spring ORM: The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring’s generic transaction and DAO exception hierarchies. • Spring Web module: The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.
  14. 14. Java Server Face(JSF) • JavaServer Faces (JSF) is a Java-based web application framework intended to simplify development integration of web-based user interfaces. JavaServer Faces is a standardized display technology which was formalized in a specification through the Java Community Process.
  15. 15. JSF Architecture
  16. 16. JSF Architecture • JavaBeans components as models containing application-specific functionality and data • A custom tag library for representing event handlers and validators • A custom tag library for rendering UI components • UI components represented as stateful objects on the server • Server-side helper classes • Validators, event handlers, and navigation handlers • Application configuration resource file for configuring application resources • JSF Architecture
  17. 17. JSF Life Cycle
  18. 18. JSF Life Cycle • Phase 1: Restore view • Phase 2: Apply request values • Phase 3: Process validation • Phase 4: Update model values • Phase 5: Invoke application • Phase 6: Render response
  19. 19. Thanks • Presenter -- Mukesh Jha Email -- Employee – ITC Infotech(Sigma Aldrich)