Marshaling and serialization are loosely synonymous in the context of remote procedure call, but semantically different as a matter of intent. In particular, marshaling is about getting parameters from here to there, while serialization is about copying structured data to or from a primitive form such as a byte stream. In this sense, serialization is one means to perform marshaling, usually implementing pass-by-value semantics. Difference b/w Marshalling and Unmarshalling 1. Convert paramaters into byte stream (suitable format for transmission) / reverse of marhalling 2. Serialization / Deserialization 3. Skeleton marshalls the result / Stub unmarshalls the result JDBC code for create tables: Difference b/w CGI (Common Gateway Interface) 1.CGI are usually executables that are native to the server’s operating system, though servlets can also be compiled to the native OS it can be compiled to Java bytecode which is then run on a JVM 2.CGI programs are platform dependent while servlets are platform independent 3.CGI programs run as separate processes on the computer while servlets run on the JVM 4.CGI can be more vulnerable to attacks than servlets (security) 5.CGI can directly process scripts while it needs to be translated and compiled to before it can be run as a servlet 6. CGI is more expensive than Servlets. Servlets can link directly to the Web server. CGI cannot directly link to Web server. Servlets can share data among each other. CGI does not provide sharing property. Servlets can perform session tracking and caching of previous computations. CGI cannot perform session tracking and caching of previous computations. Servlets are portable. CGI is not portable. In Servlets, the Java Virtual Machine stays up, and each request is handled by a lightweight Java thread. In CGI, each request is handled by a heavyweight operating system process. Uses of Servlets
|
Sem 6 > ADV JAVA LAB >