Understanding J2EE Components

You saw yesterday that modern software architecture design utilizes an n-tier model where each tier (or layer) implements one aspect of the overall solution. There are many ways to slice and dice the n-tier model, but the following list identifies the most common layers:

  • Presentation— The display of information back to the client

  • Application— Flow control logic for accessing and using the system

  • Business— Encapsulation of business rules

  • Data storage— Persistent data storage

Each layer is as loosely coupled as possible from the adjacent layers and should be completely unaware of any other layers. Put simply, a business logic component may have some knowledge of the application and data storage layers but no knowledge at all of the presentation layer.

J2EE provides a number of component technologies that sit within this layered architecture. Each technology is best suited to one or more layers, as follows:

  • JavaServer Pages (JSP)— Presentation logic back to the client, typically using HTML

  • Servlets— Application logic and business logic

  • Enterprise JavaBeans (EJBs)— Application logic, business logic and data storage

  • Application Clients— Presentation logic using Swing/AWT based applications

  • Applets— Presentation logic using powerful GUI component, typically executing in Web browser

As you can see, there is some overlap between the servlet and EJB technologies, and choosing the best technology for a given problem is not always as easy as it might seem. Sun Microsystems has written a set of J2EE blueprints for guidance on writing J2EE applications. These blueprints incorporate empirical experience as well as abstract theory and can be downloaded from:

http://java.sun.com/j2ee/1.4/download.html

The rest of today's work will briefly introduce the component J2EE technologies and how they are normally used in an n-tier architecture. The role of the supporting J2EE framework technologies is also discussed. Later lessons in this book will look at these technologies in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.104.230