Tuesday, August 19, 2014

J2EE

J2EE interview

1) What makes j2ee suitable for distributed multitiered applications?
2) What is j2ee?
3) What are the components of j2ee application?
4) Is j2ee application only web based?
5) Are Javabeans J2EE components?
6) Is HTML page a web component?
7) What is the container?
8) What are container services?
9) What is a web container?
10)  How do we package j2ee components?
11) What is a thin client?
12) What are types of j2ee clients?
13) What is deployment descriptor? 
14) What is an ear file?
15)  What is JAAS?
16) What is java naming and directory service?
17) How is MVC design pattern used in struts framework?

1) What makes j2ee suitable for distributed multitiered applications?

- J2ee platform uses a multi tiered distributed application model.
- application logic is divided into components according to function, and various application components that make up j2ee application are installed on different machines depending on the tier in multitiered j2ee environment to which application components belongs.
- j2ee application parts are:
Client tier components run on the client machine
Web tier components run on the j2ee server.
Business tier components run on the j2ee server
Enterprise information system tier software runs on the EIS server.

2) What is j2ee?

- J2ee is an environment for developing and deploying enterprise applications.
- j2ee platform consists of set of services, application programming interfaces(APIs)  and protocols that provide functionality for developing multitiered, web based applications.

3) What are the components of j2ee application?

- j2ee component is a self contained functional software unit that is assembled into J2ee application with its related classes and files and communicates with other components.
- j2ee specification defines the following j2ee components:
Application clients and applets are client components
Java servlet and jsp technology components are web components
Ejb components are business components
Resource adapter components provided by EIS and tool vendor

4) Is j2ee application only web based?

- no, it depends on type of application that client wants.
- if application client executes on client machine, it is non web based j2ee application.
- when user request, it can open an http connection to establish communication with servlet running in the web tier.

5) Are Javabeans J2EE components?

- javabeans written for j2ee platform have instance variables and get and set methods for accessing data in the instance variables.
- no, javabeans are not considered  j2ee components by the j2ee specification. 

6) Is HTML page a web component?

- no, static html pages and applets are bundled with web components during application assembly, but are not considered web components by j2ee specification.
- even the server side utility classes are not considered web components, either.

7) What is the container?

- containers are the interface between a component and the low level platform specific functionality that supports the component.
- before a web, enterprise bean, or application client component can be executed, it must be assembled into j2ee application and deployed into its container.

8) What are container services?

- container is a run time support of system level entity.
- containers provide components with service such as lifecycle management, security, deployment and threading.

9) What is a web container?

- servlet and jsp containers are collectively referred to as web containers.
- it manages the execution of jsp page and servlet components for j2ee applications. 
- web components and their container run on the j2ee server.

10) How do we package j2ee components?

- j2ee components are packaged separately and bundled into j2ee application for deployment.
- each component, its related files such as GIF and HTML files on server side utility classes and deployment descriptor are assembled into a module and added to the j2EE application.
- j2ee application is composed of one or more enterprise bean, web, or application client component modules.
- j2ee application and each of its modules has its own deployment descriptor.
- deployment descriptor is an XML document with an .xml extension that describes components deployment settings

11) What is a thin client?

- thin client is a lightweight interface to the application that does not have such operations like query database, execute complex business rules, or connect to legacy applications.

12) What are types of j2ee clients?

- applets
- application clients
- java web start enabled rich clients, powered by java web start technology.
- wireless clients, based on mobile information device profile(MIDP) technology.

13) What is deployment descriptor?

- is an extensible markup language(xml) text based file with an .xml extension that describes components deployment settings.
- j2ee application and each of its modules has its own deployment descriptor.

14)  What is an ear file?

- an ear file is standard JAR file with an .ear extension, named from enterprise archive file.
- j2ee application with all of its modules is delivered in EAR file.

15)  What is JAAS?

-  java authentication and authorization service provides way to j2ee application to authenticate and authorize specific user or group of users to run it.
- it is standard pluggable authentication module(PAM)  framework rhat extends Java 2 platform security architecture to support user based authorization.

16) What is java naming and directory service?

- JNDI provides naming and directory functionality. 
- using JNDI, J2EE application can store and retrieve any type of named java object.
- as JNDI is independent of any specific implementations, applications can use JNDI to access multiple naming  and directory services, including existing naming and directory services such as LDAP, NDS, DNS and NIS.

17)  How is MVC design pattern used in struts framework?

- in the MVC design pattern, application flow is mediated by central controller.
- controller delegates requests to an appropriate handler.
- the handlers are tied to the model
- each handler acts as an adapter between request and the mode
- model represents of encapsulates an application business logic or state.
- control is then forwarded back through controller to appropriate view.
- forwarding can be determined by consulting set of mappings, usually loaded from database or configuration file.
- this provides a loose coupling between view and the model, which can make application significantly easier to create and maintain.
- controller: servlet controller which is supplied by struts itself.
- view : what you can see on screen, JSP page and presentation components
- model: system state and business logic Javabeans.

No comments:

Post a Comment