Enterprise API's
These project guidelines were summarised from an excellent article by Bharet Mohamed, which can be found here
Java has begun providing common APIs for building enterprise functionality. A project in this area could focus on extensions to the Java language and standard class libraries or simply use one of the technologies listed below. Enterprise APIs give access to these services and provide new services that are unique to Java.
There are new Java API's appearing, many of them highly specialized. Here I cover some of the Java Enterprise API's that may be useful in a business. The API's that one can use for a project are:
A naming service is a fundamental facility in any computing system. Its the naming service by which names are associated with objects, and by which objects are found given their names. In using almost any computer program or system, you are always naming one object or another. When you use an electronic mail system, for example, you must provide the name of the recipient to whom you want to send mail. When you want to access a file in the computer, you must supply its name. Many naming services are extended with a directory service. While a naming service allows you to look up an object given its name, a directory service also allows such objects to have attributes. Therefore, in addition to lookup, you can also get an object's attributes or search for objects given their attributes. Check out JNDI page for more information.
JMS JMS is a useful tool for asynchronous communication between objects. It allows for reliable communications to happen between objects. It is also great for building messaging type systems like stock tickers, rate distribution systems, chat servers, off line processing engines etc. Unlike JNDI, there is no default implementation of JMS provided by sun, so if you want to use JMS, you have to buy a commercial implementation.
JavaMail
JavaMail (JMail) JMAIL consists of a set of abstract APIs that model a mail system. Implemented as a Java standard extension, JMail provides a framework for developing Java-based mail and messaging applications. The JMail framework is both platform-independent and protocol-independent. Service providers implement specific protocols. The JavaMail functional specification defines an interface to a messaging system, including interfaces and system components. The API can also employ a variety of message transport protocols, including Internet Message Access Protocol (IMAP) and Simple Mail Transfer Protocol (SMTP).
Java Transaction Service (JTS)
Java Transaction Service (JTS) specifies the implementation of a Transaction Manager. At the high level, the JTS Transaction Manager supports the JTA interfaces defined by the JTA Specification (java.sun.com/products/jta/jta-093.pdf) At the low level, JTS implements the Java mapping of the OMG Object Transaction Service (OTS). At the communication protocol level, JTS supports transaction interoperability between JTS Transaction Managers. To propagate the transaction context, JTS uses CORBA ORB/TS interfaces. For message format, JTS uses Inter-ORB Protocol (IIOP).
Enterprise JavaBeans (EJB)
Enterprise JavaBeans (EJB) is the server-side component architecture for Java. As the name suggests, Enterprise JavaBeans brings all the advantages of the JavaBeans component architecture to the enterprise. EJB provides a fully scalable, distributed, and cross-platform architecture that maximizes business resources. With EJB, developers can create business applications as reusable server components.
The prime motivation for the creation of EJB's was to take the complexity out of developers hands and put that complexity into the hands of application server developers. Because that complexity has been reduced, it is easier for developers to produce quality distributed systems.
Java Security
JDK 1.2 provides some limited security at its core. The reason that this is very limited security rather than full blown security and cryptography extentions is because of export laws in the US. The limited security allows you to make digital signatures on items (Message Digests) and other limited security services. The core security apis are found in package java.security.
The limitation of the security packages is that it cannot actually encrypt and decrypt whole messages. A real advantage of having security built into the core of the JDK is that you can access the security packages in any Java2 jre.
Java Cryptography Extension (JCE)
Java Cryptography Extension (JCE) is the Javasoft API for accessing cryptography services in a standard API fashion. Along with the API, Sun provides several implementations of cryptography algorithms, as well as key generation and key agreement, and Message Authentication Code (MAC). The JCE architecture revolves around the idea of a provider, a key, and a cipher.
Servlets
A servlet is a server-side component that dynamically extends Java-enabled servers. Servlets provide secure, web-based access to data that is presented using HTML web pages. Using dynamic web page generation techniques, servlets view or modify the data to which they provide access. Servlets are written in Java, and they are protocol- and platform-independent.
In general you use servlets when you want to manipulate websites or communicate to other servlets. The servlet api is very simple to use yet has alot of features that make writing cgi in java. The counterpart to Servlets (which can be thought of as HTML embedded in java) is JSP's (java embedded in HTML)
JSP
JSP stands for Java Server Pages and is the java equivalent to ASP (active server pages) by Microsoft. Are HTML with Java embedded in them which is run on the server to produce dynamic server pages.
JSP's are very cool technology because they have the dynamic nature of a script (no recompiling) yet the first time that they are accessed, they compile into a servlet on the server side.
To embed java code in a jsp, simply enclose your java code in <% -- java code %>. In order to run JSP's you need a webserver that supports them. The web servers that support servlets more than likely support JSP's as well.
Why Use the Java Enterprise APIs?
Combining APIs To Build Applications
The enterprise API's basically become reusable building blocks which you can incorporate into your application. These pieces are already tested and enable you to write less code to accomplish the same purpose. You will notice that some of the higher level apis combine lower level apis to do their functionality (EJB using JNDI and RMI/IIOP). In the same way, you can build these standard api's into your applications as you need them.
Building everything from scratch not only leads to costly software; it also separates the developer from the hard-learned lessons of other software projects. The enterprise APIs that are part of the Java platform are an attempt by Sun MicroSystems and partners to codify enterprise API and provide interfaces for interacting with it. This gives developers a vendor-neutral API to implement against, without sacrificing functionality to a least-common-denominator approach.
In many cases, enterprise networks are composed of a variety of systems, which include diverse CPU and operating system architectures. Because Java is architecture-neutral, it is a natural solution for enabling applications to run in multiple environments.
Thanks to Bharet Mohamed for help in writing this project guideline.