Computers in business
The hard job in commercial computing is not writing word processors, but to integrate the various business activities – selling, buying, managing, coordinating production.
The key asset in business computing is that data the business has collated over the years which is usually held in some form of data management system.
Business computing therefore has to integrate the front end activities carried out by users of a business application with the data held in the databases.
Changes in the data and requests from the front end must be intepreted through the business logic. 
The Two Tier model
The Two Tier model also known as the the Client Server model, consists of the following:
This can be visualized like:
Three Tier Model
The Three Tier model follows on from the Two tier architecture by making a clear separation between the server’s business logic and the data it manipulates and stores.
This model consists of the following tiers:
Presentation (Client) Tier
Application (Logic) Tier
and can be visualized like this:
Presentation (Client) Tier
The presentation tier serves as a point of entrance to the application, it can contain several different views showing the same information in many forms:
- Mobile Apps
- Fully blown applications (Java, C++, …)
- … or no views (e.g. a web service client)
Application (Logic) Tier
Unsurprisingly this runs on the application server(s). Objects, components and modules are used to encapsulate the business logic (business logic can be thought of as the storage, retrieval and processing of data).
Since the business logic is highly likely to evolve the programming approaches must be designed for change, to this end component-based designs with loose coupling and service composition are preferable as these practices lead to more flexible designs which are easier to maintain.
A cheeky aside: The J2EE standards intend to provide business objects that support the implementation of such business logic within a component based framework.
This tier is responsible for managing the data, and whether any storage, retrieval or other manipulation actions are efficient.
This can be comprised of Relational databases or NoSQL databases (based on key-value stores like Amazon Dynamo and Berkley DB or based on graphs like Neo4J).
Data Tier specifics are sometimes hidden to the application tier. The JDBC and the Java Persistence API can both be used to this effect.
Many companies are stuck with existing software due to it critical to day to day operations for this reason or others the company is heavily invested in that particular implementation and as this software functions as is necessary it rarely gets replaced. For example a lot of business systems still use COBOL.
To integrate legacy software with new systems requires software rappers that can communicate with the new systems.
What are the ingredients required to implement a Web application?
- Browsers, supplied by the clients.
- A program that handles HTTP requests according to the protocol specs from one of these client browsers.
This is all well and good but many individuals, universities, companies and opensource communities have done this before and we don’t want to re-invent the wheel badly. 
There is tonnes of well tested network stacks as well as web, application, and data servers/frameworks out there.
Demystifying Web and Application Server Language
What are web servers, web servers++ and application servers
Web servers – these simply handle HTTP requests according to the specification laid out in RFC 2616 . Examples include the popular Apache and Nginx as well as IIS and GWS.
Web servers++ – these are web servers which offer a Web server as well as additional goodies, common instances include Apache Tomcat, and Eclipse Jetty which feature JSP and Servlet containers as well as other extras.
Applications servers – these cover all your needs not only do they host and run your applications but can host middleware and function a web servers.
Middleware and J2EE
Middleware is a piece of software that sits on top of other sofware and implements reusable functionality . Often middleware exports what is known as an API (Application programming interface) to developers to allow them to utilize the power of the software beneath.
J2EE can be viewed as middleware for developing and deploying business applications, whether these applications be muti-tier, distributed enterprise scale for the web or not.
J2EE Application Servers
Common J2EE application servers include:
- Glassfish – this is the application server that was focused on during my studies and was used heavily throughout my lab work and assignment. Glassfish is typically ahead of the others in terms of J2EE compatibility
- Apache TomEE (Apache Tomcat + J2EE)
- Apache Geronimo
- JBoss (now known as WildFly)
- IBM Websphere
J2EE at a Glance
J2EE APIs – Web Container
• Servlets, JavaServer Faces, JSP (JSF and JSP uses Servlets)
• Implement Web Pages and interact with other Web Container Components and the EJB Container
• Java Persistence - uses an object/relational mapping approach to bridge the gap between an object-oriented model and a relational database
• Transactions (JTA)
• JMS (Java Messaging Service) useful for sending messages between clients providing loosely coupled, reliable and asynchronous distributed communication
• Web Services
• Context and Dependency Injection
• Expression Language
• Concurrency Utilities
- JSON handling functionality
- plus all the stuff J2SE supports
Useful acronyms to know:
- XML (eXtensible Markup Language) and XML Schema
- SOAP (Simple Object Access Protocol)
- WSDL (Web Services Description Language)
- UDDI (Universal Description, Discovery, and Integration)
- JAX-RPC (Java API for XML-based RPC)
- SAAJ (SOAP with Attachments API for Java)
- JAXR (Java API for XML Registries)
- JAXP (Java API for XML Processing)
J2EE APIs – EJB Container
The EJB container makes use of a subset of this functionality.
- Java Persistence
- Web Services
- Context and Dependency Injection
- Concurrency Utilities
- plus what J2SE supports
Other Java Enterprise Middleware
Why do such frameworks exist? Features differ between different frameworks, some are unhappy with the performance of a particular framework, or just want to create their own for the crack. Creating your own means the sky is the limit and you have ultimate control, however producing something with the feature set of J2EE from scratch would be a mammoth task. An incomplete list of frameworks in different languages can be found below and at .
Spring Framework - A holistic web and application framework
• Web Application Frameworks (built on top Servlets)
• Apache Wicket
• Apache Tapestry
• Apache Struts
• Apache Click
Ruby on Rails (Ruby)
MVC in J2EE
MVC (Model View Controller) is a common design pattern which is classified as an architectural pattern, these are useful for organizing an application during the development stages and following them can provide your applications with many useful benefits as well as making the code more flexible and maintainable.
Separation of functions
- Model encapsulates the core data and functionality
- View encapsulates the presentation of the data – there can be many views
- Controller accepts input from the user and makes request from the model for the data to produce a new view
MVC in J2EE
MVC can be seen in the structure of the J2EE framework, to demonstrate this we can simply map elements of the J2EE framework to the MVC concepts.
- View => JSP, Java Server Facelets
- Controller => HTTP Servlets, Faces Servlet
- Model => JSF Managed Beans, Enterprise Java Beans, Java Persistence and Data sources.
This post covered the basics of enterprise computing, and discussed multi-tiered models. A Brief overview of the J2EE web application framework was discussed along side other potential options. Finally I reviewed the MVC Design Pattern and how it can be seen in the J2EE model.
 Distributed Systems Course Notes, http://www.it.uom.gr/teaching/distrubutedSite/dist-sys/dist-sys.html, Ian Wakeman
 Web Applications and Services Lecture Slides, University of Sussex, George Parisis.
 RFC 2616, www.ietf.org/rfc/rfc2616.txt
 A List of Web Application Frameworks, Wikipedia, http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks