Business logic is the code that includes the functionality of an application. In the EJB (Enterprise JavaBeans) architecture, this logic is implemented by the methods of an enterprise bean.
<> DCOM represents Distributed Component Object Model. This uses ORPC (Object Remote Procedure Call) protocol to support remote objects.
<> ORPC is built on top of RPC (Remote Procedure Call) and interacts with runtime services. DCOM supports multiple interfaces and the components can be created in various programming languages. Examples of languages are Java, C, Visual Basic, etc. DCOM is widely used in windows platforms.
The following are the advantages of CORBA:
<> Supports heterogeneous object
<> Extends the capabilities of ORB (Object Request Broker)
The following are the disadvantages of CORBA:
<> Objects cannot be passed, only arguments can be passed
<> Accepted types of data can only be passed
JRMP represents Java Remote Method Protocol. This is used by Remote Method Invocation (RMI) to pass java objects as arguments.
Since Java relies on Object Serialization which marshals objects as a stream, RMI relies on the protocol JRMP to transfer objects from one JVM (Java Virtual Machine) to another.
The main components of multi-tier architecture are:
<> Presentation Tier
The front-end component existing in this tier is used to display the presentation.
<> Resource Tier
The back-end component existing in this tier is used to communicate with the database.
<> Business Tier
The component existing in this tier is used to provide business logic for the system.
For hibernate mapping, the file name should be like filename.hbm.xml.
For hibernate configuration, the file name should be like hibernate.cfg.xml.
B2b indicates to business-to-business.
The resource adapter module contains the following:
Resource Adapter deployment descriptor
There are 3 different types of JSP directives available. These are:
<> Page directive
<> Include directive
<> Taglib directive
JSP directive is the mechanism to provide metadata information to web containers about the JSP file. In the translation and compilation phases of the JSP life cycle, this Metadata is used by the web container.
The expressions used for writing dynamic content back to the client browser are called expression elements.
Two main types and subtypes of EJB are as follows:
* Session Beans
Stateful session beans
Stateless session beans
* Entity Beans
Bean Managed Persistence (BMP)
Container-Managed Persistence (CMP)
Message Driven Beans
* There is support for the integration of components from different vendors.
* Possibility to authorize the EJB component’s detailed knowledge of the environment.
* Possibility to assemble applications from separate component sources.
* Interaction with its clients is entirely specified in terms of Java interfaces.
* Portability support.
* It does not maintain resources.
URN stands for the Uniform Resource Name. It is a unique identifier that identifies an entity. But the information on where the entity is located is not available.
<> EDI represents Electronic Data Interchange. It is used for exchanging data through Value Added Network (VAN) which acts as the transmission medium.
<> EDI is expensive to install and requires customization by the exchanging clients. EDI also relies on X12 standards to interchange documents.
URL stands for Uniform Resource Locator and it is the textual reference writing standard to an arbitrary piece of data in the World Wide Web (www). The general structure of the URL is as follows:
<> protocol – Protocol is for fetching the object (example: HTTP, FTP)
<> host – Internet name of the targeted host.
<> local info – String is passed to the protocol handler on the remote host. In many cases, it is a file name with an extension.
The technology that is used to communicate between the web server and the web browser is called Secure Socket Layer (SSL). More specifically, SSL is a protocol that describes how algorithms are to be used in encryption.
The technology establishes an encrypted link between two parties and this link is allowed to secure transmission of sensitive information such as login credentials, credit/debit card information and social security numbers.
The phases of servlet lifecycle are:
<> Classloading phase – Web container loads the servlet class file (*.class).
<> Instantiation phase – By calling default no-arg constructor, the servlet class gets Instantiated.
<> Initialize phase – The method Init () called in this phase in only one time of the lifetime of a servlet. Servlet configuration is assigned to the servlet.
<> Request Handling phase – In this phase, only servlets spends most of the time. Servlet provides the services to various requests by calling Service ().
<> Removal phase – The destroy () function is called before servlet destruction. Garbage collection occurs later.
Benefits are as follows:
Possibility to organize middle-tier objects in an efficient way.
Easy initialization for properties.
Easily testable components.
Possibilities to use configuration management service of spring in any runtime environment with whatever architectural layer.
Plain Old Java Object (POJO) based development facilitates to re-use existing components.
Possible to reduce development cost by improving the productivity of the application development.
Improve the testability of application with dependency injection.
Improve maintainability with reduced code coupling.
No need to have an application server and works on enterprise service.
When the object is not available in either cache or database, the load() method throws an exception. No null values are returned from the load() method.
In hibernate, method saveorupdate() is used to update an object using the identifier. When the value for the identifier is NULL then the method is directed to call save().
<> JTA represents Java Transaction API. It is used for coordinating and managing transactions across enterprise information system.
<> JNDI represents Java Naming Directory Interface. It is used for accessing information from directory services.
<> JMS represents Java Messaging Service. It is used for receiving and sending messages through messaging systems.
The Servlet Interface must be implemented by all servlets
1> EAR represents the Enterprise Archive file. It contains the components of the web, EJB, and client. All the components are packed in a compressed file called the .ear file.
2> WAR represents Web Archive file. It contains all the components related to the web application. All the components are packed in a compressed file called the .war file.
3> JAR represents the Java Archive file. It contains all the class files and library files that constitute an API (Application Programming Interface). All the components are packed in a compressed file called .jar file.
<> Productivity: Reduced time for data access coding with the help of automatic code creation base on the defined data model.
<> Maintainability: All code generated from ORM are well tested. Only the developer is required to create the correct functionality
<> Performance: The code generated from ORM completely manages the data access needs of the application. No need to create any data access code. Also, the code is optimized to speed up the data access process.
<> Vendor independence: The code generated from ORM does not depend on the vendor. This is to increase the portability of the application.
The life cycle of a servlet consists of the following phases:
<> Servlet class loading
<> Servlet instantiation
<> the init method
<> Request handling (call the service method)
<> Removal from service (call the destroy method)
There are seven core modules in spring
The Core container module
O/R mapping module (Object/Relational)
Application context module
Aspect Oriented Programming
MVC stands Model-View-Controller.
Model: Model in many applications represent the internal state of the system as a set of one or more JavaBeans.
View: The View is most often constructed using JavaServer Pages (JSP) technology.
Controller: The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class ActionServlet. This servlet is configured by defining a set of ActionMappings.
The third-party companies that provide the software can play any of the following three roles:
<> Component Provider: Responsible for developing object modeling, programming, architecture, and business process
<> Container Provider: Responsible for proving the environment during runtime to the server
In action mapping, we specify action class for particular URL ie path and different target view ie forwards on to which request response will be forwarded.The ActionMapping represents the information that the ActionServlet knows about the mapping of a particular request to an instance of a particular Action class.The mapping is passed to the execute() method of the Action class, enabling access to this information directly.
ActionForm is a Java bean that associates one or more ActionMappings. A java bean become FormBean when extend org.apache.struts.action.ActionForm class. ActionForm object is automatically populated on the server side which data has been entered by the client from UI. ActionForm maintains the session state for a web application.
ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.The default implementation attempts to forward to the HTTP version of this method. Holding request parameters mapping and request and returns set of validation errors, if validation failed; an empty set or null
Struts framework is a Model-View-Controller(MVC) architecture for designing large-scale applications. It is a combination of Java Servlets, JSP, Custom tags, and message. Struts help you to create an extensible development environment for your application, based on published standards and proven design patterns. Model in many applications represents the internal state of the system as a set of one or more JavaBeans.The View is most often constructed using JavaServer Pages (JSP) technology.The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class ActionServlet. This servlet is configured by defining a set of ActionMappings.
An EAR file is a JAR file with an .ear extension. A J2EE application with all of its modules is delivered in an EAR file.
The following are the responsibilities of bean deployer:
<> Map fields to DB (database) columns and manage persistence
<> Define users, groups, roles, and manage security
<> Use the deployment tools and generate wrapper classes
<> Map user roles and groups
<> Ensure all the deployed bean is assigned a transaction parameter
The following are the responsibilities of the application assembler:
<> Build presentation layer i.e., user interface
<> Specify the requirements of transaction management
<> Set transaction parameters for all the bean’s methods
<> Define security roles and assign permissions
<> Specify wild card character (*) to the methods
Each of these files consists of different elements which are processed distinctly by J2EE components such as servlet containers, EJB containers and applications servers.
.ear files consist of Web, EJB and client components.
.jar files consist of class files, library files, resource files and accessory files.
The following are the responsibilities of the bean developer:
Write the systems business logic in java
Integrate java components with third party components
Control access and set transaction parameters
Create home interface to find the beans and remote interface to create business logic
Create the deployment descriptor xml
The following are the advantages of multi-tier client-server architecture:
<> Changes to business logic or user interface can be made independently
<> The client accesses data easily without knowing where data comes from and how many servers available for the system
<> The DB (database) connections can be pooled so that the data can be shared for several users without making DB request for each user
<> The middle tier component (business logic) can be written in any standard programming languages such as C or Java
The following are the components of multi-tier architecture:
Presentation Tier: The front end component is present in this tier which is used to display the presentation
Resource Tier: The back end component is present in this tier which is used to communicate with the database
Business Tier: The component present in this tier is used to provide business logic for the system
The following activities will be performed in object-oriented design:
* Decide on how classes interact with packages
* Create dependency diagrams
* Create deployment diagrams
* Decide if the components (software) reside in the deployment folder
The following activities will be performed in Architectural Design:
> The framework (example: Remote Method Invocation) to be used will be decided
> The software and hardware requirements are defined
> The performance parameter and the approach to achieve will be defined
> Analyze for reusing existing components or technology
> Define the business logic, security, and performance of the system
The following activities will be performed in Architectural Analysis:
>> Use case diagram: This is developed to depict the high level system functionality
>> Class Diagram: This is developed to depict the functionality as classes and methods
>> Collaboration Diagram: This is developed to depict how each class talk to each other
>> Sequence Diagram: This is developed to depict the operation sequence
Architecture defines the structural issues, communication protocols, data access, synchronization, and subsystems’ classification. It also defines the architectural design of the component interfaces. In Design, we define the components to be created for each interface, the inputs, the outputs, algorithms, and data structures. In short, the designers describe each component’s internal details.
The following are the roles of J2EE architect:
* Visualizing the behavior of the system
* Creating the system blueprint
* Defining the way how the system elements work together
* Defining non-functional and functional requirements
* Integrating non-functional requirements into the functional system
The following are the design goals of J2EE architecture:
<> Service Availability: The application should be available 24 * 7. The business depends on the application without the need for customer service representatives
<> Data Connectivity: The application should be able to connect to mainframe systems and other legacy systems to ensure business functions as usual
<> Accessibility: The user should be able to connect the application from anywhere and from any electronic devices
<> User Interaction: The user should be able to connect to the application from desktop, laptop, PDA, and mobile
<> Flexibility: The architecture should be created in such a way that the developer just concentrates on the business component model (business logic) and the rest of the services are handled by the server
The JavaMail API provides a set of abstract classes that model a mail system. The API provides a platform-independent and protocol-independent framework to build Java technology-based email client applications.
The Enterprise JavaBeans or EJB platform handles functions such as transaction and state management, multithreading, resource pooling, and simple searches while you concentrate on writing business logic.
<> The Java EE 5 SDK provides a complete implementation of the Java EE 5 specification along with extra features to help developers learn about what’s new and improved in the specification.
<> The Java EE 5 SDK includes the Sun Java System Application Server Platform Edition 9, the Java SE platform as its foundation, and various tools to help developers’ prototype Java EE applications and learn about the Java EE platform and technologies.