Q1. What are the benefits of load balancing?

A1: Load balancing, scalability, security

They are 1. It balances client processing requests, allowing incoming work requests to be distributed according to a configured Workload Management selection policy. 2. It provides fail over capability by redirecting client requests to a running server when one or more servers are unavailable. This improves the availability of applications and administrative services. 3. It enables systems to be scaled up to serve a higher client load than provided by the basic configuration. With server groups and clones additional instances of servers can easily be added to the configuration. 4. It enables servers to be transparently maintained and upgraded while applications remain available for users. 5. It centralizes administration of application servers and other objects.

Q2. Advantages of using Front Controller?

A:
Use a controller as the initial point of contact for handling a request. The controller manages the handling of the request, including invoking security services such as authentication and authorization, delegating business processing, managing the choice of an appropriate view, handling errors, and managing the selection of content creation strategies. The controller provides a centralized entry point that controls and manages Web request handling. By centralizing decision points and controls, the controller also helps reduce the amount of Java code, called scriptlets, embedded in the JavaServer Pages (JSP) page. Centralizing control in the controller and reducing business logic in the view promotes code reuse across requests. It is a preferable approach to the alternative-embedding code in multiple views-because that approach may lead to a more error-prone, reuse-by-copy- and-paste environment. Typically, a controller coordinates with a dispatcher component. Dispatchers are responsible for view management and navigation. Thus, a dispatcher chooses the next view for the user and vectors control to the resource. Dispatchers may be encapsulated within the controller directly or can be extracted into a separate component. While the Front Controller pattern suggests centralizing the handling of all requests, it does not limit the number of handlers in the system, as does a Singleton. An application may use multiple controllers in a system, each mapping to a set of distinct services.

Advantages: Centralizes Control A controller provides a central place to handle system services and business logic across multiple requests. A controller manages business logic processing and request handling. Centralized access to an application means that requests are easily tracked and logged. Keep in mind, though, that as control centralizes, it is possible to introduce a single point of failure. In practice, this rarely is a problem, though, since multiple controllers typically exist, either within a single server or in a cluster. Improves Manageability of Security A controller centralizes control, providing a choke point for illicit access attempts into the Web application. In addition, auditing a single entrance into the application requires fewer resources than distributing security checks across all pages.

2. as code that is common among components moves into a controller or is managed by a controller. the Service Activator locates and invokes the necessary business methods on the business service components to fulfill the request asynchronously. Improves Reusability A controller promotes cleaner application partitioning and encourages reuse. Q3: Correct convention to declare array? A: double[] vector. It reduces network calls and increases performance Q5: . On receiving a message. Q4: Service Activator Pattern Use a Service Activator 1. 3. to receive asynchronous client requests and messages.