Table of Contents

~~SLIDESHOW~~

Wrapping up!

State-of-the-Art Report and Conclusions

State-of-the-Art Report and Conclusions


Contents

The Trouble with EJB


The EJB specification was developed by Sun and a working group representing the developers of Enterprise Containers. Thus the issues addressed are mostly the concerns of someone who will be expected to host an enterprise component.

Example concerns:

A Missed Target


The whole idea of EJB was to enable the developer to concentrate on developing business entities and business logic in the secure knowledge that the container will handle all the difficult Business Tier services.

Unfortunately this “simplicity” came at a high price and was not simple at all!

Workarounds and Fixes

To make EJB development easier for developers, a number of “fixes” have been developed. Here are two examples


Xdoclet uses annotations, similar to JavaDoc tags

A code generator parses this information and creates the various interfaces and the deployment descriptor for the bean as part of the build process.

IDE Support – most of the EJB container suppliers also provide tools to make development and deployment of EJB components easy in their environment.

Of course these are designed for the specific container and (probably) won't work with a competitor's product…

… and many have an “Enterprise” price tag!

Unfortunately, the availability of such fixes and workarounds only illustrate that the EJB specification writers got it wrong!

Some Fallacies Exposed


Johnson, in his book2) exposed the fallacies listed on this slide and developed in the next few slides.

“There is a clear need for thick clients”


When Java EE was designed, the assumption was that the main application would be the provision of remote services to intelligent “thick clients”. In fact, it has happened that Web Clients became the most prevalent: a web browser talks to a web container using HTTP not RMI. Does the web container need to talk to the EJB container using RMI? Only if they are running on separate servers!

Is there a need for RMI?

Is there a need for RMI?


RMI a special case rather than the general rule?

“Objects in the business tier have to be remote”


A large number of the so called Core J2EE Patterns are designed to minimise communication over RMI! If your business objects are in the same JVM as your presentation services, a local call (using object reference) will be orders of magnitude quicker.

Removing the Remote Interfaces

Removing the Remote Interfaces

“Entity objects should be kept separate from session objects”

Don't separate data and methods

Don't separate data and methods

“You have to use Servlets and JSP in an Enterprise Application”


Web interaction is sufficiently complex that direct use of Servlets and JSPs is often counter-productive. If it succeeds, the result is often difficult to maintain and extend. This is a big problem, because user interfaces often change most often! It is better, and in the end more productive, to use one of the MVC frameworks to simplify the development of presentation services and to properly demarcate presentation from logic.

“Lifecycle methods have to be implemented in a bean”


All you need is to know where a method (e.g. transaction) should start, and where it finishes. This can be done declaratively outside the class. Standard Java reflection allows a container to look inside a class to decide where to interject a container service.

“Deployment has to be defined in a separate file”


It is surprising that more use wasn’t made of introspection in the EJB container implementation.

“The container has to manage persistence”


Transparent persistence frameworks handle updates by recording “sessions” and updating as a unit of work. A declarative transaction only needs to be informed of how to manage a persistence layer’s session to be able to include persistence operation in a transaction.

A Lightweight Java EE Application

A Lightweight Java EE Application

Contents

Better, Faster, Lighter Java

—-

The point of this discussion is not to state that there are no conditions under which the full power of the EJB specification should be used. However, the reality is that many of the situations that EJB’s architecture is designed to support, do not occur that often in practice! A number of so-called “light weight” containers have started to emerge to address these issues. We shall briefly highlight the feature of one of these.

The Spring Framework


The principles that underlay Spring were described by Rd Johnson in his book Expert one-on-one J2EE Design and Development, Wrox Press (Wiley), 2003. The Spring Framework developed from source code developed on projects and for this book Since it was “open-sourced” in 2003, Spring has seen rapid development (version 2.5.6 was released last October) and it is the subject of a number of books. It is also the framework on which Grails was constructed.

Yet another framework?

“I believe that Spring is unique3), for several reasons:

Spring Features (1)

Spring Features (2)

Interesting Technologies in Spring (2)


Supports Aspect-Oriented Programming (AOP)

Interesting Technologies in Spring (2)


Spring is designed to support ORM frameworks such as JDO and Hibernate and supports other MVC frameworks via a user interface abstraction layer.

More on Spring

Contents

Bigger Role for XML?


Client Side XML

* XML can be used to customize the user interface of a browser (e.g in Mozilla).

Server Side XML

Document Delivery Frameworks


Does this using:

Networks for Devices


Supported (in Java) by developments like JINI, PersonalJava, Java with real-time extensions and JavaCard.

Peer-to-Peer Networking

Contents

Alternatives to Java

Just because Java can handle many aspects of the modern client-server platform does not necessarily mean that it is the best way to handle such applications in all cases.

Some competing technologies worth considering:

Scripting Languages

Groovy and Grails

Multi-Language Enterprise Applications

Microsoft .NET

Software development and application delivery platform for the new century. Contains:

—-

Notes

C# is a “new” language for writing classes and components, that integrates elements of C, C++, and Java, and adds additional features, like metadata tags, related to component development.

The “common language runtime”, runs bytecodes in an Internal Language (IL) format. Code and objects written in one language can, ostensibly, be compiled into the IL runtime, once an IL compiler is developed for the language.

The set of base components, accessible from the common language runtime, that provide various functions (networking, containers, etc.) is equivalent to the Java Platform APIs.

ASP+, is a new version of ASP that supports compilation of ASPs into the common language runtime (and therefore writing ASP scripts using any language with an IL binding)

Win Forms and Web Forms, new UI component frameworks accessible from Visual Studio.

ADO+, a new generation of ADO data access components that use XML.

How do .NET and Java EE compare?

See notes


.NETJava EEKey differences
C# programming language Java programming language C# and Java both derive from C and C++. Most significant features (e.g., garbage collection, hierarchical namespaces) are present in both. C# borrows some of the component concepts from COM and VB, adds some of its own (like metadata tags), but incorporates these features into the syntax differently. Java runs on any platform with a Java VM. C# only runs in Windows for the foreseeable future. C# is implicitly tied into the IL common language runtime, and is run as just-in-time (JIT) compiled bytecodes or compiled entirely into native code. Java code runs as Java Virtual Machine (VT) bytecodes that are either interpreted in the VM or JIT compiled, or can be compiled entirely into native code.
.NET common components (aka the “.NET Framework SDK”)Java core APIHigh-level .NET components will include support for distributed access using XML and SOAP (see ADO+ below).
Active Server Pages+ (ASP+) Java ServerPages (JSP) ASP+ will use Visual Basic, C#, and possibly other languages for code snippets. All get compiled into native code through the common language runtime (as opposed to being interpreted each time, like ASPs). JSPs use Java code (snippets, or JavaBean references), compiled into Java bytecodes (either on-demand or batch-compiled, depending on the JSP implementation). IL Common Language Runtime allows code in multiple languages to use a shared set of components, on Windows. Underlies nearly all of .NET framework (common components, ASP+, etc.).
IL Common Language RuntimeJava Virtual Machine and CORBA IDL and ORBJava's Virtual Machine spec allows Java bytecodes to run on any platform with a compliant JVM. CORBA allows code in multiple languages to use a shared set of objects, on any platform with an ORB available. Not nearly as tightly integrated into Java EE framework. Similar web components (e.g., based on JSP) not available in Java standard platform, some proprietary components available through Java IDEs etc.
Win Forms and Web FormsJava Swing/Java Server FacesWin Forms and Web Forms RAD development supported through the MS Visual Studio IDE - no other IDE support announced at this writing. Swing and JSF support available in many Java IDEs and tools.
ADO+ and SOAP-based Web ServicesJDBC, EJB, JMS and Java XML Libraries (XML4J, JAXP)ADO+ is built on the premise of XML data interchange (between remote data objects and layers of multi-tier apps) on top of HTTP (AKA, SOAP). .NET's web services in general assume SOAP messaging models. EJB, JDBC, etc. leave the data interchange protocol at the developer's discretion, and operate on top of either HTTP, RMI/JRMP or IIOP.

How do they Stack Up?


.Net

Java EE

Contents

Gazing into my Crystal Ball

Back in 2005 I made some predications:


When I have some time I may update this presentation to bring it up to the state-of-the-art in 2009.

EJB 3.0

Recognising that the interests of developers where poorly served by the last versions of the EJB specification, Sun set up a working group to develop version 3.0 of the specifications.

The final spec is now in general release:

Contents

Module Summary

Thank you for your patience and long attention!

The End!

It's Been Emotional!


Home | Previous Lecture | Lectures

1)
Actually we only present what we predicated back in 2005!
2)
Rod Johnson, Expert one-on-one J2EE Design and Development, Wrox Press (Wiley), 2003.
3)
Quoted from Johnson
4)
In fact Groovy objects can be substituted for JavaBeans
5)
This is no longer true since Java has become open to scripting languages such as JRuby, Jython, Scala, and Groovy