Java News Brief        
                                          July 2000 Issue                                        

Headlines: 
Java Technical Insight of the Month
    Current Trends in Java Web Development

Visit  The Java News Brief Archive for past issues of the JNB.
OCI Educational Services
       
                
Java Technical Insight of the Month
Current Trends in Java Web Development
By Eric Burke, Senior Software Engineer, Object Computing, Inc. (OCI)

Introduction

In the dark ages (2-3 years ago!), Java Applets were the primary tool for creating web-enabled Java programs. As we all know, Applets have not lived up to the initial hype.  The reasons are numerous: Servlets were the next big thing, resolving many of the Applet problems.  Servlets execute completely on the server, so there are no issues with browser compatibility or slow download times.  Thanks to Java's threading capabilities, Servlets execute very fast.  They are also relatively easy to develop, so most companies have moved away from CGI programming in favor of Servlets.

A companion technology, JavaServer Pages (JSP), came shortly after Servlets.  JSPs are web page "templates" with special tags embedded into the HTML.  These are actually compiled into Servlets, so JSPs share the same performance characteristics that have helped to make Servlets so successful.

Recent Servlet and JSP Developments

The concept of a web application is one of the more interesting developments in the short history of Servlets and JSPs.  Now, similar to EJB Servers, Servlets are said to run inside of containers instead of Servlet engines.

Prior to version 2.2 of the Servlet specification, deployment of Servlets from the development environment to a production server was proprietary and vendor dependent.  The new Servlet container specification removes most of the vendor-specific deployment issues, making true cross-platform development achievable.

Servlet applications can also be marked as distributable, meaning that they can be deployed to many replicated containers for maximum scalability.  Since JSPs are really glorified Servlets, the same features are available to JSPs.

Custom tags are the most compelling new feature of JSPs.  With custom tags, one can avoid cluttering up HTML code with too much Java code.  As more standard tag libraries become available, non-programmers will be able to develop JSPs much more easily.

XML and the Web

The move to XML marks a fundamental shift in the way that web applications are developed today.  With XML, a clear separation between business data and presentation logic can be enforced.  To Servlet programmers, this means the end of messy println() statements that generate tons of HTML.

Instead, a style sheet is used to transform the XML document into something a browser can display, typically HTML. Different style sheets can be employed for browser-specific customizations.

Servlets do not cease to exist because of XML.  In fact, a Servlet is a key component in an XML-enabled web application, performing many tasks:

Best Practices

We have learned a lot about Servlets and JSPs over the past few years, and a set of "best practices" is beginning to emerge.  Many Servlet frameworks are under development, and all seem to offer variants of the Model-View-Controller (MVC) architecture.

In the MVC approach, Servlets, JSPs, and XML are all utilized in complementary roles.  JSPs are generally restricted to the view portion of an application.  JSPs are best when non-technical people need the ability to quickly update web pages.  Programmers can provide custom tags which enable content authors to embed standard elements such as navigation bars and standard forms.

Servlets are generally considered to be controllers, which mediate between the client web browser and the back-end data sources.  It is common to see applications which use a single Servlet that immediately passes off control to dedicated controller objects, each of which is dedicated to a particular web page or form.

XML can play the role of both model and view.  The XML document presents a structured view of data, while style sheets are a key tool for creating HTML views.  XML may be dynamically generated by an EJB component, or it may simply exist on the file system.

Summary

A key observation is that a homogeneous approach does not typically offer the best results. Developing a web site completely in JSP leads to web pages with far too much embedded programming logic.  A pure-Servlet approach leads to Java programs with too much embedded HTML, and an interface that is difficult to update without expert programmers.  A pure-XML approach is essentially impossible, because you still need Servlets to intercept client browser requests, perform session tracking, and drive the whole transformation process.

Overall, the best strategy is to focus on clean separation of user interface code (HTML) from underlying programming logic.


OCI Educational Services               

OCI has one of the most comprehensive OO training curriculums in the country.  Clients contract group training that is either taught at the client site or at an OCI Education Center in Tempe, AZ or St. Louis, MO.  We encourage you to check our our Object-Oriented Technology Curriculum show below:   (click on course titles for online descriptions)  

C ProgrammingJava Syntax for Non-C ProgrammersIntroduction to JavaObject-Oriented Analysis and DesignObject-Oriented ConceptsIntroduction to C++ for Non-C ProgrammersObject-Oriented Programming and C++Java ProgrammingDeveloping Graphical User Interfaces using JavaJavaBeans ProgrammingAdvanced Java ProgrammingCORBA ProgrammingIntroduction to CORBAData Structures and Programming Techniques in C/C++TAO's Implementation of CORBASelected Topics in Object-Oriented Programming Using the ADAPTIVE Communication Environment C++ FrameworkAdvanced C++Developing Microsoft Windows Applications in Visual C++ and MFC

For more information or to register, email training.


Object Computing, Inc. is a Sun Authorized Java Center in St. Louis and a Member of the Object Management Group, OMG.  OCI specializes in distributed computing using object-oriented and web-enabled technologies and provides Consulting, Education, and Product Development services to clients nation-wide.  For more information contact us at 314-579-0066 (St. Louis), 480-752-0042 (Tempe) or email info.

For Information on Employment Opportunities
Click here OCI CAREER OPPORTUNITIES or email hr.


The Java News Brief is a monthly newsletter.  The purpose and intent of this publication is to advance Java, provide technical value, and to announce available OCI Java services.  If you would prefer to not receive this newsletter or would like to subscribe please email JNB and enter SUBSCRIBE or UNSUBSCRIBE within the Subject line.

Copyright (c) 2000.  Object Computing, Inc.   All rights reserved.   Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.  Object Computing, Inc. is independent of Sun Microsystems, Inc.