Advanced Java Programming - Old Questions
13. Write short notes on:
- Servlet API
- RMI vs CORBA
Servlet API
Two packages javax.servlet and javax.servlet.http contains the classes and interfaces that are required to build servlet. These two packages constitute the servlet API and these are not part of the core packages. Therefore they are not included in Java Software Development Kit (JSDK).
- The javax.servlet package contains a number of interfaces and classes that establish the framework in which servlets operate.
Interfaces defined in javax.servlet package: Servlet, ServletConfig, ServletContext, ServletRequest, ServletResponse
Classes in javax.servlet packages: GenericServlet, ServletInputStream, ServletOutputStream, ServletException
- The javax.servlet.http package contains a number of interfaces and classes that are commonly used by servlet developers. Its functionality is to make easy to build servlets that work with HTTP requests and responses.
Interfaces used in javax.servlet.http package: HttpServletRequest, HttpServletResponse, HttpSession
Classes used in javax.servlet.http package: Cookie, HttpServlet
RMI vs CORBA
RMI | CORBA |
RMI is a Java-specific technology. | CORBA is independent of programming languages. It Can access foreign language objects. |
It uses Java interface for implementation. | It uses Interface Definition Language (IDL) to separate interface from implementation. |
RMI programs can download new classes from remote JVMs. | CORBA doesn't have this code sharing mechanism. |
RMI passes objects by remote reference or by value. | CORBA passes objects by reference. |
RMI uses the Java Remote Method Protocol as its underlying remoting protocol. | CORBA use Internet Inter- ORB Protocol (IIOP) as its underlying remoting protocol. |
The responsibility of locating an object implementation falls on JVM. | The responsibility of locating an object implementation falls on Object Adapter either Basic Object Adapter or Portable Object Adapter. |
Distributed garbage collection is available integrated with local collectors. | No distributed garbage collection is available |
Generally simpler to use. | More complicated. |
It is free of cost. | Cost money according to the vendor. |
| CORBA has better scalability. |