Java™ Servlet 2.5 API

Package Diagram Example

An example of UML 2.5 package diagram representing most important interfaces and classes of Java™ Servlet 2.5 API. This API is described in Java Servlet Specification Version 2.5 and is a required (part of) API of the Java Platform, Enterprise Edition ("Java EE"), version 5.

Application Programming Interface (API) is a common programming term which is usually defined as a set of interfaces, classes and some rules specifying how some client of the API could (re)use the services and/or resources provided by the software component implementing that API.

Note, UML 2.5 does not provide notation or a stereotype to support modeling of APIs. On the diagram below Servlet API is notated as a package stereotyped as «API», which is not a standard UML stereotype.

A servlet is a Java class directly or indirectly implementing Servlet interface of the Java Servlet API. Java EE documentation usually refers to servlets as web components. Life cycle of servlets is managed by a web container. The web container is provided as a part of a web server or Java EE application server.

Java Servlet 2.5 API consists of two packages: javax.servlet and javax.servlet.http. The javax.servlet package contains a number of interfaces and classes (both abstract and concrete) that describe and define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container.

The javax.servlet.http is package containing API interfaces and classes specialized for the servlets supporting HTTP protocol and corresponding runtime environment.

UML package diagram of Java Servlet 2.5 API interfaces and classes.

UML package diagram representing major interfaces and classes of Java™ Servlet 2.5 API.

Two abstract classes in the Java Servlet API that implement the Servlet interface are GenericServlet and HttpServlet. The HttpServlet is usually extended by developers to implement application specific servlets supporting HTTP protocol.