Terms and Definitions
July 1st, 2007 by Wes Wannemacher
Technical material is usually filled with terms that the author generally assumes that the reader will already know. I will try be consistent with the words and phrases that I use. However, I hope to use this entry to keep a set of decent definitions that will hopefully be helpful to the readers. Please make comments and suggestions so that I can improve this entry as time passes.
Definitions |
Web Application - There is a technical definition for web application (or web-app) somewhere within the Java Servlet Specification, but for the purposes of this book, the term ‘web application’ or ‘web-app’ will loosely point to any development project intended to run on a web server and viewed by the customers with a web browser. In a Java context, a web-app has a few more requirements than a web-app written in another language. A Java web-app has a fixed directory structure and can be packaged as a WAR file. Java web-apps are self-contained so that their resources, dependent libraries and configuration files are all part of the directory structure. The well-defined layout of a Java web-app allows web-apps to be very portable. This portability allows web-apps to be developed and tested in one environment and easily moved to a QE or production web server.
API - API stands for Application Programming Interface. APIs in Java typically consist of a set of objects that developers will use to add some functionality to a project. Many complicated tasks can be abstracted and easily performed using an API that other developers have made available. The Java Development Kit (or JDK) comes with a set of objects which make up the basic Java objects such as String, and File. Some parts of the core JDK distribution, like JDBC which provides SQL database access objects and routines, existed as independent APIs before being rolled into the JDK. Java offers other sets of objects as separate downloads such as the JavaMail API. An API can be distributed in source or compiled form.
Library - A library is another term for API. In the C/C++ platform, sets of independent, distributable objects and routines are usually called libraries (libc, glib, xlib, etc.).
Framework - A Framework is similar to an API because it is used to accomplish a set of tasks within a project without spending time creating reusable components from scratch. What separates a framework from an API is size and scope. Most APIs are devoted to accomplishing a single task or implementing one protocol. Frameworks often provide facilities to manage much more complicated problems such as allowing a consistent code style within a large project, or providing a consistent look-and-feel within a large GUI-based project. A framework will often include related resources such as graphical elements or UI widgets to help the developers using the framework.
Development Platform - The development platform is the set of technologies a developer works with that will provide an underlying system for the project. In traditional desktop application development, the platform would refer to the operating system. Modern web applications are considered N-tier applications, which means a web browser communicates with a web server which will launch and/or interact with the code written by the developers which will in turn send and receive data from a database -
browser <-> server <-> application code <-> database
When discussing web application development, the development platform can refer to the technologies running on the web server (server, application code and database). One alternate web application development platform that is very popular is called LAMP which stands for Linux, Apache, PHP and MySQL. When developing Java web applications, Java is the platform. The term platform will refer to the JDK being used, the application server software used, or the IDE used by the developer.
Application Server - Java web application development differs from other technologies because rather than writing individual stand-alone scripts with short life-cycles (executing only during the request and response), the code in the Java web applications are extensions of the web server itself. For Java to extend the web server, the web server must conform to the Servlet and JSP specifications. Any web server that conforms to the Servlet and JSP specifications will be referred to as an Application Server. Examples of Applications Servers include Apache Tomcat, IBM WebSphere, BEA WebLogic, Jetty, and Caucho’s Resin. Since the Servlet and JSP specifications are freely available, anyone can create an Application Server and there is some healthy competition in the Application Server market. The application server a developer chooses will depend on many factors, not least important is the familiarity of the Systems Administrators. In theory, since Application Server vendors create their server based on the Servlet and JSP specifications, a well-written Java web application will work in any Application Server that supports the Servlet and JSP specifications used during development. In practice, it is best for developers to test their applications in all of the potential Application Servers to ensure that the web application runs correctly and performs acceptably under the estimated load.
Custom Tags - Custom Tags are a technology that is unique to the JSP environment. A developer can use Java code to create a small reusable component that can be placed into JSP code to perform some server-side programmatic task. For instance, many pages of a site need to present the first name of the user who is viewing the page, a Java developer can create a tag that finds the user’s name where ever it may be available and outputs it. This tag can be placed on each JSP that requires it. When the storage location of the name changes, the code for the tag can be revised and the class file for the tag can be reinstalled and no changes need to be made to the JSPs that use it (unless of course the usage of the tag changes). Reuse is possible in many different ways, but the boon of custom tags is that the usage syntax is similar to the usage of HTML tags. Since the syntax is natural to HTML developers, tasks can be divided in a way that allows developers to concentrate on their individual strengths (Java developers working on data access and processing components and HTML developers working on aesthetics and UI splendor).
Tag Library - A Tag Library is a set of useful tags packaged and distributed together which help web application developers accomplish related tasks. The Java Standard Tag Library, or JSTL, is a useful Tag Library that many developers use to implement functionality without reverting to scriptlet code within the JSP file. JSTL includes looping tags, logic tags and tags that output data stored in scoped variables. Although these tasks can all be done with Java code, JSP code with custom tags is considered easier to maintain than JSP files with scriptlet code. Struts2 contains a vast set of custom tags often referred as the Struts2 tag library.
Unit Test - A Unit Test is a small, repeatable item which is created specifically to check that application components perform the tasks they were designed to do. Unit tests are very helpful if it is possible to create and run them easily. A Java project known as JUnit is a platform designed to allow developers to write and run tests with ease. It is helpful on Java projects to create unit tests for the utility components such as the classes which access data from a database or perform the business logic processing. Whenever changes are made to the utility components, the unit tests can be launched to make sure that changes are not introducing unanticipated bugs. For example, in a fictitious project a utility class named AuthorFinder may be created to look up the authors of a book. To find the list of authors, AuthorFinder uses the book’s ISBN. A unit test called AuthorFinderTest could then be created that instantiates a Book object and retrieves the book’s authors using the AuthorFinder class. Sometime after the Book and AuthorFinder classes are developed, the Book class is enhanced to support books which do not yet have an ISBN. When the unit tests are run, the developer can then see if the AuthorFinder class is able to handle the revised Book class. If AuthorFinderTest finds that AuthorFinder throws a NullPointerException, then the bug can be found easily and handled while the project is still in development.
AJAX - AJAX is a relatively new technology in web development. AJAX as an acronym stands for Asynchronous JavaScript and XML. XML is not required to use AJAX, but the acronym has remained. AJAX allows developers to make a request to the server and handle the server’s response asynchronous to the user’s interaction with the web browser. It can be thought of as hitting a server and dealing with the results in the background. One of the most common uses is to hit the web server and update the page that is currently loaded in the browser. For instance, if a JSP file is created that lists the contents of the user’s shopping cart, when the user clicks a “Display Cart” link the browser will request the JSP and insert its results into the page (without a refresh). Many sites have adopted AJAX as a way to improve the usability and decrease the throughput of the server. If many of the common requests can be responded to with only the content that needs to be inserted into the page, then the server has less
data to send back to the browser. AJAX can be difficult to adopt within a project because many web application development frameworks were written without considering AJAX (such as Struts1) and because it is difficult to ensure cross-browser compatibility. Struts2’s integration of the Dojo toolkit allows many AJAX tasks to be done without developers writing any JavaScript code, and AJAX tasks that cannot be accomplished with Struts2 tags can be written using Dojo functions which ensure cross-browser compatibility and easy integration.
Design Pattern – A design pattern is a method for solving architecture problems. It is similar to an algorithm, but design patterns usually deal with a different scope of problems. Architects will insist on a particular design pattern when the benefits of the suggested design pattern are in-line with the long term goals of a project. A design pattern is typically adopted throughout the entire scope of a project, whereas an algorithm may be used to solve one task within the project. Design patterns are adopted many times without a developer’s knowledge because many design patterns, when implemented, are considered good design (such as Functional design which indicates that a project should be broken into small modules which have limited responsibility). Algorithms are generally written in pseudo-code or real code, but design patterns are written as a document. Since the definition of a design pattern does not usually offer an implementation, implementing a design pattern is more abstract than implementing an algorithm.
This entry was posted on Sunday, July 1st, 2007 at 1:25 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
Spread the Word
del.icio.us Digg Furl Reddit StumbleUpon Technorati
You can leave a response, or trackback from your own site.
June 21st, 2008 at 3:21 pm
Springframework work best for me in the framework category.
August 7th, 2008 at 9:18 pm
I always thought Spring should be used in Java web app, but i never needed it.Struts is far better than Spring web framework . I might use it its for the transactional services,