J2EE Key Notes

Photo by Javier Saint Jean on Unsplash
  • Client-tier: Run-on the client machine.
  • Web tier components: Run-on the J2EE server.
  • Business tier: Run-on the J2EE server.
  • Enterprise Information System software (EIS software): Runs on the EIS server.
  • Applets
  • Application clients
  • Java Web Start enabled clients, by Java Web Start technology.
  • Wireless clients, based on the Mobile Information Device Profile (MIDP) technology.

Object-Relational mapping (ORM)

The mapped objects in a Java class to the tables of the relational database using metadata describes the database and object mapping. The working method is to transform data from one representation to another.

  • Productivity: Reduced time for data access coding with the help of automatic code creation base on the defined data model.
  • Maintainability: All code generated from ORM are well tested. Only the developer is required to create the correct functionality
  • Performance: The code generated from ORM completely manages the data access needs of the application. No need to create any data access code. Also, the code is optimized to speed up the data access process.
  • Vendor independence: The code generated from ORM does not depend on the vendor. This is to increase the portability of the application.

Hibernate

Hibernate is an open-source object-relational mapping and query service which facilitates writing Hibernate Query Language (HQL) scripts instead of Structured Query Language (SQL) scripts. It is a fast and easy process than writing native SQL. Hibernate has more powerful object-oriented contents like associations, inheritance, and polymorphism. Also, it has powerful compositions and collections.

  • Slow: execution of HQL queries is slower.
  • Only composite key support is available and it prevents advanced query options.
  • No shared value type references are available.
  • Database and vendor independence application.
  • Standard Object-relational mapping support.
  • Domain object mapping for a relational database.
  • Better performance than Java Database Connectivity.
  • Java Persistence API based applications.
  • save() stores an object into the database. There is a check for duplicate records
  • saveorupdate() used to update an object using the identifier. if the identifier is NULL a new record will be created.
  • load() vs get(): When the object is not available in either cache or database, the load() method throws an exception but get() returns null.

Spring

Spring is an open-source application that reduces the complexity of enterprise application development. Spring is based on an inversion of control or dependency injection design patterns.

  • Plain Old Java Object (POJO) based development facilitates to re-use existing components.
  • reduce development cost
  • Improve the testability with dependency injection.
  • Improve maintainability with reduced code coupling.
  • No need to have an application server and works on enterprise service.
  • Easy initialization for properties.
  • Easily testable components.
  • Lightweight container.
  • Possibilities to use configuration management service of spring in any runtime environment with whatever architectural layer.
  • Possibility to organize middle-tier objects in an efficient way

Servlets

servlets are Server-side component that provides a powerful mechanism to create platform-independent programs support various protocols like HTTP.

  • Classloading: Web container loads the servlet class file (*.class).
  • Instantiation: Instantiate By calling default no-arg constructor,
  • Initialize: Init () called and configuration is assigned to the servlet.
  • Request Handling: Servlet provides the services by calling Service ().
  • Removal phase: The destroy () function is called before servlet destruction. Garbage collection occurs later.

Enterprise Java Beans (EJB)

is the server-side component that executes in EJB container and encapsulates the business logic for the enterprise application.

  • Persistence
  • Security
  • Transaction
  • Connection pooling
  • Component lifecycle management
  • Threading
  • The behavior is specified by interfaces.
  • loosely coupled and tired.
  • Implementation is hidden from the client-side.
  • The EJB container supports the application developer.
  • The API to the application is in session tier.
  • The API to the data sources is in the entity tier.
  • Support for the integration of components from different vendors.
  • Possibility to authorize the EJB component’s detailed knowledge of the environment.
  • Possibility to assemble applications from separate component sources.
  • Interaction with its clients is entirely specified in terms of Java interfaces.
  • Portability support.
  • It does not maintain resources.
  • Session Beans: Stateful session beans, Stateless session beans
  • Entity Beans: Bean Managed Persistence (BMP), Container-Managed Persistence (CMP),Message Driven Beans

JSP

Types of tags associated with JSP

  • Directives
  • Declarations
  • Scriptlets
  • Expressions

MVC

MVC stands for Model View Controller.

  • Model: represents the internal state of the system as a set of Java Beans.
  • View: Most often the view is constructed using Java Server Pages (JSP) technology.
  • Controller: The controller is the process that focuses on receiving client requests and produce the next level of a user interface according to the request.

JSF

JSF stands for Java Server Faces. It is the user interface (UI) designing framework for Java Web application developments based on MVC. There is a set of reusable UI components associated with JSF. The automated data saving process from form to server and display at the client side is also handled by JSF.

Connection Pooling

Is a mechanism to re-use the existing connections. It maintains a number of already created object connections and when there is a demand, existing connection are used.

Thin client

A program interface that does not have any operations like database queries, complex business rules or any connection to the third-party application is called a thin client.

file types ear, jar war?

  • *.jar files — containing libraries, resources, and accessories
  • *.war files — The files that are required for the development of web application (HTML, java scripts, JSP)
  • *.ear files — The files for Enterprise Java Beans modules for the application

Secure Socket Layer (SSL)

establishes an encrypted link between web server and the web browser to allow secure transmission of sensitive information such as login credentials, credit/debit card information and social security numbers.

Java beans

Action form: A Java bean that is associated with single or multiple action mapping is called an action form. Action form objects are automatically populated at the server end when data has been entered from the client side through a user interface (UI).Session states of a web application are maintained by action forms.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nuwan Zen

Nuwan Zen

Sometimes A software Engineer, sometimes a support engineer, sometimes a devops engineer, sometimes a cloud engineer :D That’s how the this life goes!