|
Java Enterprise Development StacksHere is a bottom-up clarification of Java software development without the sales hype. I'm working on organizing this better. Let me know what you find helpful or missing. |
|
|
Java StacksJava has evolved considerably and continues to evolve rapidly. I've broken down the various technologies (and associated acronyms) into the concern
|
The Purpose of Each Stack Layer
|
Java Application Server
Add-ons include Terracotta for JVM clustering, Tangosol's Coherence Data Grid, JSF 1.2 is compatible with these.
|
Who Cares?Liferay Portal's architecture is based on the SASH stack:
The AndroMDA system uses this architecture:
|
JSF (Java Server Faces) HistoryJSF was published in 2004 as JSF 1.1 (by the JSR-127 Expert Group operating under Sun/Oracle's Java Community Process (JCP). This first version of JSF introduced a stateful and event-driven architecture versus Struts' stateless action architecture. JSF 1.2 was published (by the JSR-252 expert group) in 2006 as part of J2EE 5. JSF 1.2 was added to provide an event model based on the classical request-response development model. It did not define a standard for implementing AJAX. So AJAX libraries are not interoperable on the same app with JSF 1.2. JSF 2.0 began work in May 2007 (by the JSR-314 Expert Group). It aims to improve the JSF model for faster development and easier integration with other important frontend technologies. Sun's Reference implementations of JSF ("Mojarra" jsf-api.jar and jsf-impl.jar) has these dependencies:
|
ResourcesJSF for nonbelievers: Clearing the FUD about JSF by Richard Hightower, CTO of ArcMind
|
Servlet Containers
Java Servlets were defined by Sun as programs written in Java that reside on a Web server and respond to user requests (much like CGI programs used to do). Servlet containers take care of parsing HTTP requests, managing sessions, and compiling JavaServer Pages (JSPs).
|
Struts Action Framework
Business logic code implementing the functionality or rules for specific applications are done by a custom subclass of class org.apache.struts.action.Action. Apache Struts Struts is called "action based" because, being built on Sun's servlet API, a Struts form is intercepted in the server by a single instance (the "master" ActionServlet) that delegates actual work to subclasses of ActionForm and Action. Craig McClanahan at Sun created Struts as part of a project to internationalize an application. Struts also hasten development of Web applications' user input validation, error handling, reporting, and flow control. ActionServlet helper classes automatically take care of behind-the-scenes activities such as initializing Struts extensions (plug-ins), reading configuration data, and pooling Action subclasses (for efficiency). Craig went on to lead the development of Sun's JSF (Java Server Faces). Apache Struts websites:
|
|
JSF Extendability
Many features of JSF are designed to be pluggable/extendable: |
.xhtml File View Handlers
In a race to enable thin browser clients to be as highly interactive as fat Java client apps built using Swing, the "View" portion of this architecture has undergone very rapid series of improvements. Instead of Struts, many have gone to JSF (Java Server Faces), then to Facelets. The availability of anlternative JSF view handler to JSP (the default JSF view-handler) enabled Jacob Hookom (an independent software developer living in Eden Prairie, MN) to create Facelets after he was inspired by the June 2004 article "Improving JSF by Dumping JSP" by Hans Bergsten. The Jasper JSP parser reads XML-style JavaServer Page (.jspx) markup. But Faclets uses the SAX XML parser to read XML compliant HTML (.xhtml) markup. So compiling Faclets can be 30% faster than JSP pages. Facelets is the premier view-handler in JSF 2.0. Facelets tag library components provide powerful templating and composite component features: Each xhtml file is called a view. Since Faclets replace JSP, an IDE can be tricked into supporting Facelets by using .jspx file extensions with <jsp:root jsfc=“f:view”>. |
|
UI Component Suite Libraries
JSF is the base for $799/year commercial tool Exadel's Visual (web) Component Platform Eclipsed-based Exadel Studio to enable developers to add AJAX capabilities without writing Javascript code. Its pre-built, customizable plugable RichFaces code defines user interfaces through one of 14 "skins" that define themed UI schemes (colors, fonts, corner sharpness, and 3D effects). Facelets JSF-oriented view technology is used to build a screen. Render Kits enable components to render themselves according to multiple client devices. Like GWT, ICEfaces uses browser-specific renderers to circumvent cross-browser JavaScript problems.
Enhancements to the JSF-RI (Reference Implementation) components to build UI include Apache MyFaces Tomahawk Extensions Apache MyFaces, at 1.1.3 with Shale, is dependent on the cactus 13-1.7.1 jar, junit 3.8.1 jar, and org.apache.struts.shale 1.0.2 jar test framework. To avoid full page refreshes, Ajax4JSF is used to render and replace individual components in the single screen that JSF manages as a tree of components. This competes with JBoss RichFaces 3.3. These typically support open-source Eclipse SDK IDE, (Galileo). as well as MyEclipse, NetBeans. Support for IntelliJ, IDE Eclipse 3.2 (Ganymede) plug-ins for NetBeans, |
Navigation Handlers and ScopesUntil JSF 2.0, there was no standards for a scope which is longer than a request scope but shorter than a session. So several projects have emerged to provide it:
|
EL (Expression Language)
Struts and JSF build on the JSP Standard Tag Library Expression Language (JSTL EL). The following traces what happens internally to bind the View to the Model.
When using ICEfaces, namespecs are instead specied in this tag: <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" When using ICEfaces, also specify the namespec used by <ice: tags: xmlns:ice="http://www.icesoft.com/icefaces/component" <ice: tags replace <h: tags. The CSS file for ICEsoft to use can then be specified: <ice:outputStyle href="./xmlhttp/css/xp/xp.css" /> The "xp" in the above references to the ICEfaces XP theme. Alternately, the Royale or Rime theme provided with the library can be specified. #{myBean.firstNumber} specifies a run-time (deferred) evaluation of the myBean. ${CalcBean.firstNumber} specifies a compile-time (immediate) evaluation of the CalcBean.
The JSF v1 (Model 1 architecture) supported static include tags such as <jsp:useBean>. Unlike the XML in Struts' tag library, JSF tag library (JTLB) is event-driven, much like the architecture of Apple's WebObjects and Microsoft's ASP.net. Under JSF 2.0 that Sun open sourced under their CDDL license, .tag files in the WEB-INF/tags folder which provides compile-time checking for required parameters as they are compiled into tag handlers. Model backing beans map between view and model.
|
AxisAccording to the README, AXIS stands for "Apache eXtensible Interaction System". Apache Axis is an implementation of the SOAP ("Simple Object Access Protocol") defined by the W3C that generates WSDL published by SOAP service providers. SOAP is a XML-based lightweight transport protocol that uses WSDL to represent remote procedure calls and responses in a decentralized, distributed environment. The SOAP specification defines the envelope framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing JAX-RPC API remote procedure calls and responses. (supported by WSO2) is a tool for building applications that use Web services in an SOA. |
SpringThe Spring Framework was conceived by Rod Johnson in his book "J2EE without EJB" and supported by Interface 21. Unlike J2EE EJBs, Spring is lighter weight in that it makes use of POJO and a standard web container such as Apache Tomcat. Spring simplifies creation of server-side Java programs. Enforces decent software engineering practices and design patterns. Provide convenient wrappers for other technologies. |
HibernateHibernate Hibernate was originally written by Gavin King, who was hired by JBoss under RedHat. Is is now the time-tested leader among Open-Source ORM (object-relational mapping) layer java persistance solutions for writing Java programs that does �smart update" of databases. It creates CRUD+S SQL statements based on metadata, autogenerating Java classes (source code) which have mappings to database tables. Hibernate also simplifies parent-child persistence by doing �lazy" instantiation, (Semi) transparent data caching, and optimistic locking. |
Establishing the Java Stack
Here is the sequence our Java-based stack is created:
|
SASH TestsSeveral applications to test the SASH stack (now obsolete) are available:
Grinder was used for load stress injection. JMeter was used for lightweight apps.
[swik] is where tests results and source code are available on the SWiK.NET Open Source community for comment and re-use. SourceLab's transaction-test framework are based on TPC-C schema that aims to simulate non-trivial real-world scenarios.
In competition to SourceLabs is SpikeSource, which focuses on the Linux OS. JAMon (Java Application Monitor) The "Trails" demo is based on Tapestry. The "AppFuse" demo uses Spring's HibernateTemplate that is not efficient. |
SASHDisto
The SASH-1.2.dist folder consists of folders docs, licenses, sampleapps/sash-starter, and sash-1.2-repo. The SASH sample apps follow a strictly layered architecture: |
Related:
--------
|
| ||
|