{"id":5,"date":"2018-07-10T06:14:19","date_gmt":"2018-07-10T06:14:19","guid":{"rendered":"http:\/\/itp16.epgpbooks.inflibnet.ac.in\/2018\/07\/10\/chapter-1\/"},"modified":"2022-01-06T10:30:04","modified_gmt":"2022-01-06T10:30:04","slug":"chapter-1","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/chapter\/chapter-1\/","title":{"rendered":"Introduction to Distributed Application Development"},"content":{"raw":"<div><span style=\"float: right;\"><a href=\"https:\/\/youtu.be\/Ys0pOxd9rUo\" target=\"_blank\" rel=\"noopener noreferrer\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Introduction to the Paper<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">This paper has been divided into several modules. We have around 36 modules. In this module, we will be talking about the introduction of the paper. What are the various modules which we have? because this is DAD, its all going to be based on a client-server paradigm. I will also talk about the client-server paradigm.<\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong>What is Distributed Application Development?<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">It is about developing applications whose components have been divided into several parts. Rather than having all the facilities available in the particular application, being available in a single place as a single executable or something, Rather than having 1 such heavy-weight thing, we would have our application divided into several tiers(n-tiers). What is the role of each and every tier? How they interact? how the various things would perform? What are the various components?<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">There is one aspect which is of the interface. As far as the interfacing is concerned, the interface would normally be a web interface. Most of the modules are concentrating on that web-interface. We have chosen the Java technology for demonstrating the various aspects of Distributed Application Development, but it is not the only way.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">There are various other technologies available. Java is one of the most common technology which is openly available and more popular. When it is Distributed Application Development, it not just one particular technology which can be used. Other options are also available.<\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong>Client Server paradigm<\/strong><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\">What do we understand by the client server paradigm?<\/p>\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\">If you look at the real world also, what is a server? or what is a client?<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Any kind of service being provide by someone, he is a server and we have clients who utilize the service. There is going to be communication involved in all these. There is going to be communication between two seperate components. One of the components, the one who is giving service just has to wait and listen and he is not the initiator of the communication. The initiator of the communication is always going to be the client.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Even if someone has developed a Java class, the methods which are in the Java class are used by someone. That is being used by some other developer. That particular application which makes use of or invokes a method. Oh even that is a client server. There is someone who initiated and invokes a method and this component here is providing a method. this all happens within a thread. If this would be separated out and done by separate threads, it would be more like a client-server.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: center;\"><strong>Browser is also a client interacting with some web server<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Let us also have an overview of what all modules we are having in this paper. The kind of flow that we have over all these modules.<\/p>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify;\"><strong style=\"text-align: initial; font-size: 1em;\">Overview of the Modules<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-indent: -1em; font-size: 1em;\">What we have done in this particular paper is , we have initially started with a module on networking. Networking is mainly about how to communication between two processes which are on two different hosts.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We do have inter-process communication which happens between processes within the same machine\/host. Even that is also client-server paradigm, because there is someone who is making service available. There is interaction which is done by another component. The interaction <\/span>initiated<span style=\"font-size: 1em;\">\u00a0by someone, that is a client. The one with whom the interaction is actually taking place, that is a server.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have to interact with someone to get some information, so the other person is the service provider and we are the client if we are asking for something. We have one particular host having a particular process running and we have another host form where we have an application which would like to interact with that other process. The interaction with that process is by giving some request and getting some response.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Networking<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The second module is on Networking where we will learn TCP\/IP connection and communication. How to create TCP\/IP connection. How two processes can interact over TCP\/IP connection. One more thing here, Most of our concentration in all these modules is actually on writing more on the server side, there are a few things here which are also for the client side.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We will be using the java.net package, Socket, ServerSocket, these are the basic classes. We will talk about these in the second module..<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Multi-threading and concurrency<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The third module is about multithreading. in this case, the server wont be giving service to one client at a time. In second module , we develop an EchoServer. In third module, we will make that EchoServer such that even if there are multiple clients asking for service simultaneously, it should still be able to give service to all of them. So, for this on server side, we need multi-threading. Third Module is a demonstration of how to develop a multi-threaded network server. So, whatever server we develop in second module, in third module we make it multi-threaded.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The concurrency aspect is managed by the developer who is writing the server. But from Java 5 onwards we have some more mechnism, where the concurrecy aspect is handled independent of what is to be done. So we have APIs added in Java 5 called concurrency API. Fourth module is about using those kind of APIs and improving upon the code developed in third module. It demonstrates how we can control concurrency, in an existing Java application which was simply using multi-threading.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Remote Method Invocation<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">As was mentioned earlier, if someone is invoking a method on an object, it is also a client-server paradigm. if we are using java technology, we are more close to using Object-oriented way of solving problems. So we design classes and in classes we have got methods.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The fifth module is about RMI. So RMI is actually about how do we create objects on which method invocation can be done from a remote place. So developing such kind of objects. RMI is actually a Java technology but it would help you to create components for which method invocation can be done by any client from any place. Such components will be created. So that is what will be covered in fifth module.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: center;\"><strong style=\"text-align: center; text-indent: -1em; font-size: 1em;\">To demonstrate the RMI based development, a simple ChatServer may be developed.<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the sixth module will be developing the server side of the chat server. It demonstrated how to develop a simple chat server. We have the seventh module which would actually be talking about developing the client side of the chat server application.So we can have a working chat server application there.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JDBC<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Another very important type of service that we require. we may have the requirement of persisting the data. we have lots of data that needs to be saved. If we have objects, those objects need to be persisted. So for the purpose of persistence, one of the things which is very commonly used is the databases.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">So we have database services, we have lots of databases. Different kinds of databases can be there. What we have in Java is we have a standard way of using databases.The standardization which was earlier available to the programmers of C in the form of ODBC. Similar to that ODBC, for Java programmers, we have got JDBC. We have got the JDBC APIs available as part of java.sql package. We have two modules here. Eighth and Ninth Modules would cover about the JDBC APIs.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In these modules we will talk about how to make a <\/span>connection<span style=\"font-size: 1em;\">\u00a0with the database in a standard way. So any standard Java application should be able to make connection to any kind of database, provided their JDBC drivers are available.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">HTTP<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The tenth and eleventh modules will be about <\/span>understanding<span style=\"font-size: 1em;\">\u00a0the HTTP protocol. The tenth module explains exactly what HTTP protocol is, and the format of the HTTP protocol, the format of the request of the HTTP, format of the response of the HTTP. We would understand that in the tenth module.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the eleventh Module we talk about what is there in Java APIs for HTTP protocol, how anyone can be a client to an HTtp server. Eleventh module is actually about the HTTP client application.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have many other popular protocols which have things being managed in terms of resources..We have a URL to represent the resource. The resource is nothing but something which gives us content. How do we get a content for a given URL.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">By becoming a client, we can download content form any kind of a server, by using its URL.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Applet<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The twelfth and thirteenth modules talk about Applet. Twelfth module also introduces the concept of a container. Applet used to be a very important component in Java for the client side for the web application. Now we have lot many other things which have replaced applets. How the applet was working, is an important concept that we introduce while talking about the applet and the life-cycle.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The concept of a container and a component. We have seen that applets are something which would work inside a browser. What exactly is the relation between the browser and the Applet. The Applet is being managed by the browser. How the <\/span>browser<span style=\"font-size: 1em;\">\u00a0would be managing it, the exact kind of interactions. The browser is actually on the client side but the server component the class file is stored on the server side. so it is actually brought into the client's browser and working inside the client's browser.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">This aspect has been brought out in twelfth module. The thirteenth Module 13 is more about the rest of the Applet related APIs. In the twelfth module we would be talking about the Applet\u2019s <\/span>life-cycle<span style=\"font-size: 1em;\">. How the component which is our Applet here, is managed within the container. The component would have a life-cycle because the creation and all of those aspects of that component is actually done by a container. It is the browser who creates the objects of applets. and interacts with it to let it know things happening within the container. So that is the <\/span>life-cycle<span style=\"font-size: 1em;\">\u00a0of Applet and then we have various things, which the applet should then be able to interact with the browser and get help from the browser to do certain operations available in the browser. The container is giving it some environment, how that environment is made available to the component. The component interacting with the container, container interating with the component.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Java EE<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">There are so many aspects in developing a Distributed Application. In this paper we mainly concentrate on web applications but there are so many other things which are requirements of an Enterprise Applications. Enterprise applications are always Distributed Applications. What are the various components which are needed in enterprise applications. We have Java enterprise edition, everything here is in terms of specifications. The fourteenth module gives an overview of Java EE. What are the various requirements of the enterprise applications? There are common requirements of enterprise applications and these requirements have nothing to do with the domain for which the application is developed. We have common problems across all enterprise applications. and therefore all enterprise applications need some common infrastructure. So we don\u2019t have to develop that infrastructure every time. That is where we have the concept of an application server which is used for our applications.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Enterprise applications would normally work on an application server. The developer doesn't create the infrastructure. he develops the components, just like the applet was the component for the container. So we have lots of different kinds of containers to give different types of services. we just need to create those different smaller smaller components and its more about deploying and configuring them on the server side. The fourteenth to gives an overview of all those things.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet Containers<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the fifteenth module talk about the web application. What is there in a web application. There are the Servlet specifications which are useful for a web application. The web application structure is there if we are using Java based components.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In Servlet specification there is a specific structure on how your web applications must be managed. We have some kind of a very good directory structure to manage all the components, all the resources which are to be part of web application So the definition, structure of web application, there is some XML file called web.xml, which is the deployment descriptor, what goes in the deployment descriptor, how it would be interpreted, there are various things in web.xml. how they are going to be interpreted by the container. all these aspects are covered in the fifteenth module.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet Life-cycle<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the sixteenth module we talk about very basic component in the servlet specification. it is the Servlet component.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">First we introduce the Servlet interface where we talk about the life-cycle of the Servlet. It talks in details about the life-cycle of Servlet. when a Servlet starts, it is going to address a particular resource, its going to address a particular URL.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">When the Servlet starts it finds in order to give the service, there are certain resources which it is dependent upon and those resources are not yet up, even then what should it be doing? It is not that we get down to a Servlet and that Servlet gives an error. The container could be informed about it and the container at its own level could take care of giving the proper responses to the client, in case this particular Servlet component is down. We have a detailing on the life cycle methods. There are actually three life cycle methods. all these detailing is done in sixteenth module.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet APIs<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the seventeenth and eighteenth modules, we go on to look at other components of servlet specifications. In servlet specification, we have components which the application developer would create, we have components which are going to be available to the application developer. As far as object creation is concerned, it is going to be entirely done by the container. All objects are managed by the container.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">So we have only few components which the application developer creates or he defines. Rather, he defines Servlet and other components which we will cover in other subsequent modules. but what is going to be available to this particular servlet, he is going to be made available, configuration information by using ServletConfig. he is going to be made available the component for interaction with the container. How does he interact with the container and know about the entire web application? He wants to use other components in the web application or he wants to dispatch his request somewhere. So we have various kinds of components. Its a huge API. we have some basic API that has been covered in seventeenth module. we have eighteenth module looking at some more components. So, modules seventeen and eighteen gives us lot of information related to the Servlet API.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet-Http specific APIs<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">The servlet specification is very general. its actually divided into two parts. We have a very general part of the Servlet specification, which we would be applicable to any protocol. for eg. we even have Servlet for SIP protocol also. It is not only about HTTP protocol, but most commonly it would be the HTTP protocol.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">We first look at the API from generic point of view. So, there we have Servlet and we even talk about a class called GenericServlet and then later we have the eighteenth module which are specific to HTTP. So we have the nine module which is the HTTP specific API. We have something like the HttpServlet<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">In generic form we had only Servlet and GenericServlet but then we have HttpServlet. Here it uses HttpServletRequest, HttpServletResponse. Those are the interfaces which we will come across when we look at HTTP specific API. These are http specific components which any servlet specification will have to support. A Servlet Container may be supporting other protocols but this is something which is must. So any Servlet Container has to have this.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-indent: -1em; font-size: 1em;\">Then we have the twentieth module which covers things like cookies and sessions.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Filters and Listeners<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Then we have the twenty first and the twenty second modules which talk about Filters and Listeners.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Servlet is not the only kind of components that the application developer creates. An application developer has certain requirements of using something like interceptor whenever a request comes. So, we have something called a Filter in the twenty first module, and then the twenty second module would be talking about Listeners.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Listeners are nothing but something like event dispatcher, event handlers. We have various events taking place within the container, or even at the start of the application we would like to do certain things. So we have those event classes. Similar to classes from the classical event delegation model being used here.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have subclasses of java.util.EventObject class and we have Listeners which extend from java.util.EventListener. so all those things are there and we have the Listeners being discussed in the twenty second module.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSP<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">After this, as far as the web is concerned, we move to the interface aspect. When we want to give someone a good web interface, we need to divide our job. Programmers would be good at processing part. Having a good design is a separate role of a webpage designer. who uses tags. so we have the next set of modules which talk on JSP\u00a0<\/span><span style=\"font-size: 1em;\">it would normally be a task not of a programmer but of a web-page designer. In JSP we can have Java code entering within the tags. In JSP, within the tags, we can embed the Java code but, web designer is not a Java programmer, so he won\u2019t understand Java programming. We cover those kind of elements which go in a JSP in the twenty third module.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We then subsequently move on to those things which are saying, do away with those kind of Java coding inside a JSP.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the twenty fourth module we talk about JSP Directives, and then in later modules we also talk about what we call as tags.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">There are those standard tags which are available for web page designer. Web page designers are used to tags. He gets all the functionality which he would normally require for having those use of the Java component which are going to be available in a JSP. These are the things, which are on the back-end side only, but the design appears on the front end.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSPs are one kind of servlets only. but the one who writes JSP is a web page designer.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Custom Tags<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">After looking at the standard tags, we have something by which, even a programmer, if he wishes can create his own tags. We have modules thirty and thirty one which explains about how, if some programmer, if he wants make custom tags, to make it available to a webpage designer. how those custom tags can be created. How he can develop a library of those tags. how those tags can be deployed. That has been covered in the thirty first module..<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSTL and EL<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Once having seen that we can have these kind of custom tags, there are certain tag libraries. There is some project from Apache which was a development of standard tag library called JSTL. That is very commonly being used with JSP. We have a standard set of tags so that we don\u2019t keep on developing that commonly required ones. We discuss those <\/span>standard tags<span style=\"font-size: 1em;\">, the JSTl. there is another things, a simplistic way of using objects within our JSP page.that is known as EL(expression language). so we cover JSTL and EL in thirty third and thirty fourth modules.<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">MVC \u2013 Model-View-Controller<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We also have twenty sixth module talking about the architecture for web applications, which is the MVC architecture for developing web applications. We have a module to show you how different components can be managed. So that we have, for eg. the interface design, which should be in a JSP, but if we have any interaction from a client, he is making some query, he has to go to a database. that is something which a programmer will be doing. So we have Servlet doing that, we have controller, we have model classes. so dividing into MVC. JSP is the view part of MVC model. Model would be basic Java Beans components.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We discuss the Java Beans for creating those basic components in twenty fifth module. Having seen all the things about JSP,<\/span><\/p>\r\n&nbsp;\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Security<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Another very important thing is security for any Distributed Application. We have thirty fifth module, talking about security in general. In this module we talk about security in general.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">what is a key pair. what is a private, public key. what is meant by a certificate, what is a key store and the tools used for managing a key store. What is meant by signing something. A tool available in Java for signing the jar files. When we use Java technology, we have lot of jar files, most of things in these jar files are classes. So how do we have someone endorsing these. So we talk about security in general first.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have thirty sixth module which would talk about security in web applications (nothing but a set of resources). Resources are URLs from client point of view. So certain URLs need to be protected. They have to be only available to authorized persons. So we have security for a web application. How authentication will be carried out.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">These things can be done by some declarations in the deployment <\/span><span style=\"font-size: 1em;\">descriptor<\/span><span style=\"font-size: 1em;\">. so that is being covered in the thirty sixth module for web security.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">That is how we go about in this particular paper.<\/span><\/p>\r\n\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Introduction to Distributed Application Development<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/Ys0pOxd9rUo\" target=\"_blank\" rel=\"noopener noreferrer\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"font-size: 1em;\">Suggested Reading:<\/strong><\/p>\r\n\r\n<ol>\r\n \t<li class=\"hanging-indent\" style=\"text-align: justify;\">Core Java Volume 2 by Cay Horstmann &amp; Gary Cornell, Ninth Edition, Pearson Education.<\/li>\r\n \t<li style=\"text-align: justify;\">The class of JAVA by Pravin Jain, Pearson Education.<\/li>\r\n \t<li style=\"text-align: justify;\">Beginning Java Networking by Alexander V Konstantinou and others, Wrox publication.<\/li>\r\n \t<li style=\"text-align: justify;\">Java RMI By William Grosso O\u2019Rielly media<\/li>\r\n \t<li style=\"text-align: justify;\">Database programming with JDBC and Java by George Reese. O'Reilly Media<\/li>\r\n \t<li style=\"text-align: justify;\">Java Server Programming for Professionals by Ivan Bayross, Sharanam Shah, Cynhthia Bayross and Vaishali Shah Shroff Publishers and Distributros.<\/li>\r\n \t<li style=\"text-align: justify;\">Java EE 7 Essentials: Enterprise Developer Handbook by Arun Gupta, O\u2019Reilly<\/li>\r\n \t<li style=\"text-align: justify;\">Core Servlets and Java Server Pages Volume 1 by Marty Hall &amp; Larry Brown, Second Edition, Pearson Education.<\/li>\r\n \t<li style=\"text-align: justify;\">Core Servlets and Java Server Pages Volume 2 by Marty Hall &amp; Larry Brown, Second Edition, Pearson Education.<\/li>\r\n<\/ol>","rendered":"<div><span style=\"float: right;\"><a href=\"https:\/\/youtu.be\/Ys0pOxd9rUo\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Introduction to the Paper<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">This paper has been divided into several modules. We have around 36 modules. In this module, we will be talking about the introduction of the paper. What are the various modules which we have? because this is DAD, its all going to be based on a client-server paradigm. I will also talk about the client-server paradigm.<\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong>What is Distributed Application Development?<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">It is about developing applications whose components have been divided into several parts. Rather than having all the facilities available in the particular application, being available in a single place as a single executable or something, Rather than having 1 such heavy-weight thing, we would have our application divided into several tiers(n-tiers). What is the role of each and every tier? How they interact? how the various things would perform? What are the various components?<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">There is one aspect which is of the interface. As far as the interfacing is concerned, the interface would normally be a web interface. Most of the modules are concentrating on that web-interface. We have chosen the Java technology for demonstrating the various aspects of Distributed Application Development, but it is not the only way.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">There are various other technologies available. Java is one of the most common technology which is openly available and more popular. When it is Distributed Application Development, it not just one particular technology which can be used. Other options are also available.<\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong>Client Server paradigm<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\">What do we understand by the client server paradigm?<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\">If you look at the real world also, what is a server? or what is a client?<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Any kind of service being provide by someone, he is a server and we have clients who utilize the service. There is going to be communication involved in all these. There is going to be communication between two seperate components. One of the components, the one who is giving service just has to wait and listen and he is not the initiator of the communication. The initiator of the communication is always going to be the client.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Even if someone has developed a Java class, the methods which are in the Java class are used by someone. That is being used by some other developer. That particular application which makes use of or invokes a method. Oh even that is a client server. There is someone who initiated and invokes a method and this component here is providing a method. this all happens within a thread. If this would be separated out and done by separate threads, it would be more like a client-server.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong>Browser is also a client interacting with some web server<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Let us also have an overview of what all modules we are having in this paper. The kind of flow that we have over all these modules.<\/p>\n<\/div>\n<p style=\"text-align: justify;\"><strong style=\"text-align: initial; font-size: 1em;\">Overview of the Modules<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-indent: -1em; font-size: 1em;\">What we have done in this particular paper is , we have initially started with a module on networking. Networking is mainly about how to communication between two processes which are on two different hosts.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We do have inter-process communication which happens between processes within the same machine\/host. Even that is also client-server paradigm, because there is someone who is making service available. There is interaction which is done by another component. The interaction <\/span>initiated<span style=\"font-size: 1em;\">\u00a0by someone, that is a client. The one with whom the interaction is actually taking place, that is a server.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have to interact with someone to get some information, so the other person is the service provider and we are the client if we are asking for something. We have one particular host having a particular process running and we have another host form where we have an application which would like to interact with that other process. The interaction with that process is by giving some request and getting some response.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Networking<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The second module is on Networking where we will learn TCP\/IP connection and communication. How to create TCP\/IP connection. How two processes can interact over TCP\/IP connection. One more thing here, Most of our concentration in all these modules is actually on writing more on the server side, there are a few things here which are also for the client side.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We will be using the java.net package, Socket, ServerSocket, these are the basic classes. We will talk about these in the second module..<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Multi-threading and concurrency<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The third module is about multithreading. in this case, the server wont be giving service to one client at a time. In second module , we develop an EchoServer. In third module, we will make that EchoServer such that even if there are multiple clients asking for service simultaneously, it should still be able to give service to all of them. So, for this on server side, we need multi-threading. Third Module is a demonstration of how to develop a multi-threaded network server. So, whatever server we develop in second module, in third module we make it multi-threaded.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The concurrency aspect is managed by the developer who is writing the server. But from Java 5 onwards we have some more mechnism, where the concurrecy aspect is handled independent of what is to be done. So we have APIs added in Java 5 called concurrency API. Fourth module is about using those kind of APIs and improving upon the code developed in third module. It demonstrates how we can control concurrency, in an existing Java application which was simply using multi-threading.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Remote Method Invocation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">As was mentioned earlier, if someone is invoking a method on an object, it is also a client-server paradigm. if we are using java technology, we are more close to using Object-oriented way of solving problems. So we design classes and in classes we have got methods.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The fifth module is about RMI. So RMI is actually about how do we create objects on which method invocation can be done from a remote place. So developing such kind of objects. RMI is actually a Java technology but it would help you to create components for which method invocation can be done by any client from any place. Such components will be created. So that is what will be covered in fifth module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong style=\"text-align: center; text-indent: -1em; font-size: 1em;\">To demonstrate the RMI based development, a simple ChatServer may be developed.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the sixth module will be developing the server side of the chat server. It demonstrated how to develop a simple chat server. We have the seventh module which would actually be talking about developing the client side of the chat server application.So we can have a working chat server application there.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JDBC<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Another very important type of service that we require. we may have the requirement of persisting the data. we have lots of data that needs to be saved. If we have objects, those objects need to be persisted. So for the purpose of persistence, one of the things which is very commonly used is the databases.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">So we have database services, we have lots of databases. Different kinds of databases can be there. What we have in Java is we have a standard way of using databases.The standardization which was earlier available to the programmers of C in the form of ODBC. Similar to that ODBC, for Java programmers, we have got JDBC. We have got the JDBC APIs available as part of java.sql package. We have two modules here. Eighth and Ninth Modules would cover about the JDBC APIs.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In these modules we will talk about how to make a <\/span>connection<span style=\"font-size: 1em;\">\u00a0with the database in a standard way. So any standard Java application should be able to make connection to any kind of database, provided their JDBC drivers are available.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">HTTP<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The tenth and eleventh modules will be about <\/span>understanding<span style=\"font-size: 1em;\">\u00a0the HTTP protocol. The tenth module explains exactly what HTTP protocol is, and the format of the HTTP protocol, the format of the request of the HTTP, format of the response of the HTTP. We would understand that in the tenth module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the eleventh Module we talk about what is there in Java APIs for HTTP protocol, how anyone can be a client to an HTtp server. Eleventh module is actually about the HTTP client application.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have many other popular protocols which have things being managed in terms of resources..We have a URL to represent the resource. The resource is nothing but something which gives us content. How do we get a content for a given URL.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">By becoming a client, we can download content form any kind of a server, by using its URL.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Applet<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The twelfth and thirteenth modules talk about Applet. Twelfth module also introduces the concept of a container. Applet used to be a very important component in Java for the client side for the web application. Now we have lot many other things which have replaced applets. How the applet was working, is an important concept that we introduce while talking about the applet and the life-cycle.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">The concept of a container and a component. We have seen that applets are something which would work inside a browser. What exactly is the relation between the browser and the Applet. The Applet is being managed by the browser. How the <\/span>browser<span style=\"font-size: 1em;\">\u00a0would be managing it, the exact kind of interactions. The browser is actually on the client side but the server component the class file is stored on the server side. so it is actually brought into the client&#8217;s browser and working inside the client&#8217;s browser.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">This aspect has been brought out in twelfth module. The thirteenth Module 13 is more about the rest of the Applet related APIs. In the twelfth module we would be talking about the Applet\u2019s <\/span>life-cycle<span style=\"font-size: 1em;\">. How the component which is our Applet here, is managed within the container. The component would have a life-cycle because the creation and all of those aspects of that component is actually done by a container. It is the browser who creates the objects of applets. and interacts with it to let it know things happening within the container. So that is the <\/span>life-cycle<span style=\"font-size: 1em;\">\u00a0of Applet and then we have various things, which the applet should then be able to interact with the browser and get help from the browser to do certain operations available in the browser. The container is giving it some environment, how that environment is made available to the component. The component interacting with the container, container interating with the component.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Java EE<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">There are so many aspects in developing a Distributed Application. In this paper we mainly concentrate on web applications but there are so many other things which are requirements of an Enterprise Applications. Enterprise applications are always Distributed Applications. What are the various components which are needed in enterprise applications. We have Java enterprise edition, everything here is in terms of specifications. The fourteenth module gives an overview of Java EE. What are the various requirements of the enterprise applications? There are common requirements of enterprise applications and these requirements have nothing to do with the domain for which the application is developed. We have common problems across all enterprise applications. and therefore all enterprise applications need some common infrastructure. So we don\u2019t have to develop that infrastructure every time. That is where we have the concept of an application server which is used for our applications.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Enterprise applications would normally work on an application server. The developer doesn&#8217;t create the infrastructure. he develops the components, just like the applet was the component for the container. So we have lots of different kinds of containers to give different types of services. we just need to create those different smaller smaller components and its more about deploying and configuring them on the server side. The fourteenth to gives an overview of all those things.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet Containers<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the fifteenth module talk about the web application. What is there in a web application. There are the Servlet specifications which are useful for a web application. The web application structure is there if we are using Java based components.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In Servlet specification there is a specific structure on how your web applications must be managed. We have some kind of a very good directory structure to manage all the components, all the resources which are to be part of web application So the definition, structure of web application, there is some XML file called web.xml, which is the deployment descriptor, what goes in the deployment descriptor, how it would be interpreted, there are various things in web.xml. how they are going to be interpreted by the container. all these aspects are covered in the fifteenth module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet Life-cycle<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the sixteenth module we talk about very basic component in the servlet specification. it is the Servlet component.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">First we introduce the Servlet interface where we talk about the life-cycle of the Servlet. It talks in details about the life-cycle of Servlet. when a Servlet starts, it is going to address a particular resource, its going to address a particular URL.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">When the Servlet starts it finds in order to give the service, there are certain resources which it is dependent upon and those resources are not yet up, even then what should it be doing? It is not that we get down to a Servlet and that Servlet gives an error. The container could be informed about it and the container at its own level could take care of giving the proper responses to the client, in case this particular Servlet component is down. We have a detailing on the life cycle methods. There are actually three life cycle methods. all these detailing is done in sixteenth module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet APIs<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the seventeenth and eighteenth modules, we go on to look at other components of servlet specifications. In servlet specification, we have components which the application developer would create, we have components which are going to be available to the application developer. As far as object creation is concerned, it is going to be entirely done by the container. All objects are managed by the container.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">So we have only few components which the application developer creates or he defines. Rather, he defines Servlet and other components which we will cover in other subsequent modules. but what is going to be available to this particular servlet, he is going to be made available, configuration information by using ServletConfig. he is going to be made available the component for interaction with the container. How does he interact with the container and know about the entire web application? He wants to use other components in the web application or he wants to dispatch his request somewhere. So we have various kinds of components. Its a huge API. we have some basic API that has been covered in seventeenth module. we have eighteenth module looking at some more components. So, modules seventeen and eighteen gives us lot of information related to the Servlet API.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Servlet-Http specific APIs<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">The servlet specification is very general. its actually divided into two parts. We have a very general part of the Servlet specification, which we would be applicable to any protocol. for eg. we even have Servlet for SIP protocol also. It is not only about HTTP protocol, but most commonly it would be the HTTP protocol.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">We first look at the API from generic point of view. So, there we have Servlet and we even talk about a class called GenericServlet and then later we have the eighteenth module which are specific to HTTP. So we have the nine module which is the HTTP specific API. We have something like the HttpServlet<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em; text-indent: -1em;\">In generic form we had only Servlet and GenericServlet but then we have HttpServlet. Here it uses HttpServletRequest, HttpServletResponse. Those are the interfaces which we will come across when we look at HTTP specific API. These are http specific components which any servlet specification will have to support. A Servlet Container may be supporting other protocols but this is something which is must. So any Servlet Container has to have this.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-indent: -1em; font-size: 1em;\">Then we have the twentieth module which covers things like cookies and sessions.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Filters and Listeners<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Then we have the twenty first and the twenty second modules which talk about Filters and Listeners.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Servlet is not the only kind of components that the application developer creates. An application developer has certain requirements of using something like interceptor whenever a request comes. So, we have something called a Filter in the twenty first module, and then the twenty second module would be talking about Listeners.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Listeners are nothing but something like event dispatcher, event handlers. We have various events taking place within the container, or even at the start of the application we would like to do certain things. So we have those event classes. Similar to classes from the classical event delegation model being used here.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have subclasses of java.util.EventObject class and we have Listeners which extend from java.util.EventListener. so all those things are there and we have the Listeners being discussed in the twenty second module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSP<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">After this, as far as the web is concerned, we move to the interface aspect. When we want to give someone a good web interface, we need to divide our job. Programmers would be good at processing part. Having a good design is a separate role of a webpage designer. who uses tags. so we have the next set of modules which talk on JSP\u00a0<\/span><span style=\"font-size: 1em;\">it would normally be a task not of a programmer but of a web-page designer. In JSP we can have Java code entering within the tags. In JSP, within the tags, we can embed the Java code but, web designer is not a Java programmer, so he won\u2019t understand Java programming. We cover those kind of elements which go in a JSP in the twenty third module.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We then subsequently move on to those things which are saying, do away with those kind of Java coding inside a JSP.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">In the twenty fourth module we talk about JSP Directives, and then in later modules we also talk about what we call as tags.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">There are those standard tags which are available for web page designer. Web page designers are used to tags. He gets all the functionality which he would normally require for having those use of the Java component which are going to be available in a JSP. These are the things, which are on the back-end side only, but the design appears on the front end.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSPs are one kind of servlets only. but the one who writes JSP is a web page designer.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Custom Tags<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">After looking at the standard tags, we have something by which, even a programmer, if he wishes can create his own tags. We have modules thirty and thirty one which explains about how, if some programmer, if he wants make custom tags, to make it available to a webpage designer. how those custom tags can be created. How he can develop a library of those tags. how those tags can be deployed. That has been covered in the thirty first module..<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">JSTL and EL<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Once having seen that we can have these kind of custom tags, there are certain tag libraries. There is some project from Apache which was a development of standard tag library called JSTL. That is very commonly being used with JSP. We have a standard set of tags so that we don\u2019t keep on developing that commonly required ones. We discuss those <\/span>standard tags<span style=\"font-size: 1em;\">, the JSTl. there is another things, a simplistic way of using objects within our JSP page.that is known as EL(expression language). so we cover JSTL and EL in thirty third and thirty fourth modules.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">MVC \u2013 Model-View-Controller<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We also have twenty sixth module talking about the architecture for web applications, which is the MVC architecture for developing web applications. We have a module to show you how different components can be managed. So that we have, for eg. the interface design, which should be in a JSP, but if we have any interaction from a client, he is making some query, he has to go to a database. that is something which a programmer will be doing. So we have Servlet doing that, we have controller, we have model classes. so dividing into MVC. JSP is the view part of MVC model. Model would be basic Java Beans components.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We discuss the Java Beans for creating those basic components in twenty fifth module. Having seen all the things about JSP,<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"text-align: initial; text-indent: -1em; font-size: 1em;\">Security<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">Another very important thing is security for any Distributed Application. We have thirty fifth module, talking about security in general. In this module we talk about security in general.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">what is a key pair. what is a private, public key. what is meant by a certificate, what is a key store and the tools used for managing a key store. What is meant by signing something. A tool available in Java for signing the jar files. When we use Java technology, we have lot of jar files, most of things in these jar files are classes. So how do we have someone endorsing these. So we talk about security in general first.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">We have thirty sixth module which would talk about security in web applications (nothing but a set of resources). Resources are URLs from client point of view. So certain URLs need to be protected. They have to be only available to authorized persons. So we have security for a web application. How authentication will be carried out.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">These things can be done by some declarations in the deployment <\/span><span style=\"font-size: 1em;\">descriptor<\/span><span style=\"font-size: 1em;\">. so that is being covered in the thirty sixth module for web security.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 1em;\">That is how we go about in this particular paper.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Introduction to Distributed Application Development<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/Ys0pOxd9rUo\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"hanging-indent\" style=\"text-align: justify;\"><strong style=\"font-size: 1em;\">Suggested Reading:<\/strong><\/p>\n<ol>\n<li class=\"hanging-indent\" style=\"text-align: justify;\">Core Java Volume 2 by Cay Horstmann &amp; Gary Cornell, Ninth Edition, Pearson Education.<\/li>\n<li style=\"text-align: justify;\">The class of JAVA by Pravin Jain, Pearson Education.<\/li>\n<li style=\"text-align: justify;\">Beginning Java Networking by Alexander V Konstantinou and others, Wrox publication.<\/li>\n<li style=\"text-align: justify;\">Java RMI By William Grosso O\u2019Rielly media<\/li>\n<li style=\"text-align: justify;\">Database programming with JDBC and Java by George Reese. O&#8217;Reilly Media<\/li>\n<li style=\"text-align: justify;\">Java Server Programming for Professionals by Ivan Bayross, Sharanam Shah, Cynhthia Bayross and Vaishali Shah Shroff Publishers and Distributros.<\/li>\n<li style=\"text-align: justify;\">Java EE 7 Essentials: Enterprise Developer Handbook by Arun Gupta, O\u2019Reilly<\/li>\n<li style=\"text-align: justify;\">Core Servlets and Java Server Pages Volume 1 by Marty Hall &amp; Larry Brown, Second Edition, Pearson Education.<\/li>\n<li style=\"text-align: justify;\">Core Servlets and Java Server Pages Volume 2 by Marty Hall &amp; Larry Brown, Second Edition, Pearson Education.<\/li>\n<\/ol>\n","protected":false},"author":4,"menu_order":1,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["mr-pravin-jain"],"pb_section_license":""},"chapter-type":[47],"contributor":[58],"license":[],"class_list":["post-5","chapter","type-chapter","status-publish","hentry","chapter-type-standard","contributor-mr-pravin-jain"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapters\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":19,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapters\/5\/revisions"}],"predecessor-version":[{"id":432,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapters\/5\/revisions\/432"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapters\/5\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/pressbooks\/v2\/chapter-type?post=5"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/wp\/v2\/contributor?post=5"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp16\/wp-json\/wp\/v2\/license?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}