May 22, 2007

What is a Web Service

Why SOA?

SOA architecture enables seamless Enterprise Information Integration. Here are some of the Benefits of the Service Oriented Architecture:

  • Due to its platform independence, it allows companies to use the software and hardware of their choice .
  • There is no threat of vendor lock-in
  • SOA enables incremental development, deployment, and maintenance.
  • Companies can use the existing software (investments) and use SOA to build applications without replacing existing applications
  • The training costs are low, so the available labor pool can be used for running the applications

Connections

Connections means the link connecting these self-contained distributed services with each other, it enable client to Services communications. In case of Web services SOAP over HTTP is used to communicate the between services

Services

A service is a function or some processing logic or business processing that is well-defined, self-contained, and does not depend on the context or state of other services.

Well Defined

An expression is called "well defined" (or unambiguous) if its definition assigns it a unique interpretation or value.

Loose coupling

Loose coupling describes a resilient relationship between two or more systems or organizations with some kind of exchange relationship.
In Web Services or Service Oriented Architecture, loose coupling may mean simply that the implementation is hidden from the caller.

Electronic Data Interchange (EDI)

Electronic Data Interchange (EDI) is widely-used technology for the automated exchange of documents between dissimilar applications. It allows value chain partners to exchange purchase orders, invoices, advance ship notices and other business documents directly from one business system to the other, without human intervention. Proven advantages are fewer errors, lower administrative costs, and faster order-to-cash cycles.

May 21, 2007

Technical Summary

1. Java
2. Struts
3. Spring
4. SOA
5. JSF
6.

JSF Overview

What is JSF?

JSF is new standard framework , developed through Java Community Process (JCP) , that makes it easy to build user interfaces for java web applications by assembling reusable components in a page.

JSF includes mainly:

  1. Set of APIs to represent and manage state of components that helps server side validation, event handling, page navigation, data conversion etc.
  2. JSP custom tag library to create UI components in a view page.
Goal of JSF is to create web applications faster and easier.

Conclusion:
JSF is a framework, that makes its easy to build user interfaces for java web applications by assembling reusable components in a page.

Spring Overview

What is Spring?
Spring is an open source framework created by Rod Johnson to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development.
Mission
Spring's main aim is to make J2EE easier. It does this by enabling a POJO-based programming model that is applicable in a wide range of environments.

Conclusion:
Spring is an open source framework for J2EE, use for complexity of of enterprise application development.
Its layered architecture allows you to select which of its components use for you application.

Struts Overview

Struts is an open source framework used for developing J2EE web applications using Model View Controller (MVC) design pattern.
Struts framework provides three key components:
  1. A request handler provided by the application developer that is used to mapped to a particular URI.
  2. A response handler which is used to transfer the control to another resource which will be responsible for completing the response.
  3. A tag library which helps developers to create the interactive form based applications with server pages.
The Controller : This is the heart of the container. Most Struts application will have only one controller that is ActionServlet which is responsible for directing several Actions.
Model : The model is basically a business logic part which takes the response from the user and stores the result for the duration of the process.
View : The view in struts framework is mainly a jsp page which is responsible for producing the output to the user.
Conclution:
Struts is a open source framework used for developing J2EE application using Model View Controller (MVC) design pattern.

SOA Overview

Service Oriented Architecture or SOA for short is a new software architecture for the development of loosely coupled distributed applications.
In fact service-oriented architecture is collection of many services in the network. These services communicate with each other and the communications involves data exchange & even service coordination.
Broadly SOA can be classified into two terms: Services and Connections.

Java Overview

What's Java?
  1. Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s.
  2. Java applications are typically compiled to bytecode, although compilation to native machine code is also possible.
  3. At runtime, bytecode is usually either interpreted or compiled to native code for execution.
History
  1. Java started as a project called "Oak".
  2. The first public implementation was Java 1.0 in 1995.
  3. 2006, Sun released parts of Java as free/open source software, under the GNU General Public License (GPL)
Features
Java=> Java bytecode: portable
Java=>Native code: fast
Java=> Java bytecode: JIT compilation and dynamic recompilation allow Java programs to take advantage of the speed of native code without losing portability.
  • Automatic garbage collection

Extensions and related architectures

  • Java EE (previously J2EE) (Java Platform, Enterprise Edition—for distributed enterprise applications)
  • Java ME (previously J2ME) (Java Platform, Micro Edition—for PDAs and cellular phones)
  • JMF (Java Media Framework)
  • JNDI (Java Naming and Directory Interface)
  • JSML (Java Speech API Markup Language)
  • JDBC (Java DataBase Connectivity)
  • JDO (Java Data Objects)
  • JAI (Java Advanced Imaging)
  • JAIN (Java API for Integrated Networks)
  • JDMK (Java Dynamic Management Kit)
  • Jini (a network architecture for the construction of federated distributed systems)
  • Jiro
  • Java Card (Java for smart cards)
  • JavaSpaces
  • JML (Java Modeling Language)
  • JMI (Java Metadata Interface)
  • JMX (Java Management Extensions)
  • JSP (JavaServer Pages)
  • JSF (JavaServer Faces)
  • JNI (Java Native Interface)
  • JXTA (Open Protocols for Peer-to-Peer (P2P) Virtual Network)
  • Java 3D (A high level API for 3D graphics programming)
  • JOGL (Java OpenGL—A low level API for 3D graphics programming, using OpenGL)
  • LWJGL (Light Weight Java Game Library—A low level API providing access to OpenGL, OpenAL and various input devices)
  • OSGi (Dynamic Service Management and Remote Maintenance)
  • JMonkey Engine (High performance scene graph based 3D engine)

May 18, 2007

Applying aspect-oriented programming

Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules.

Conclusion:
Aspect-oriented programming is a programming technique that allows programmers to separate application business logic from system services

Understanding inversion of control

The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then responsible for hooking it all up.
Conclusion:
Do not create objects directly but describe how they should be create.

Spring Module

The Spring framework is made up of seven well-defined modules (figure 1.1).The core container
Spring’s core container provides the fundamental functionality of the Spring framework. In this module you’ll find Spring’s BeanFactory, the heart of any Spring-based application. A BeanFactory is an implementation of the factory pattern that applies IoC to separate your application’s configuration and dependency specifications from the actual application code.
Application context module
The core module’s BeanFactory makes Spring a container, but the context module is what makes it a framework. (The Spring context is a configuration file that provides context information to the Spring framework). This module extends the concept of Bean-Factory, adding support for internationalization (I18N) messages, application life cycle events, and validation.
In addition, this module supplies many enterprise services such as e-mail, JNDI access, EJB integration, remoting, and scheduling. Also included is support for integration with templating frameworks such as Velocity and FreeMarker.
Spring’s AOP module
Spring provides rich support for aspect-oriented programming in its AOP module. This module serves as the basis for developing your own aspects for your Spring-enabled application.
JDBC abstraction and the DAO module
Working with JDBC often results in a lot of boilerplate code that gets a connection, creates a statement, processes a result set, and then closes the connection.
Object/relational mapping integration module
For those who prefer using an object/relational mapping (ORM) tool over straight JDBC, Spring provides the ORM module. Spring doesn’t attempt to implement its own ORM solution, but does provide hooks into several popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps.
Spring’s web module
The web context module builds on the application context module, providing a context that is appropriate for web-based applications.
The Spring MVC framework
Spring comes with a full-featured Model/View/Controller (MVC) framework for building web applications. Although Spring can easily be integrated with other MVC frameworks, such as Struts, Spring’s MVC framework uses IoC to provide for a clean separation of controller logic from business objects.

What is Spring?

Spring is an open-source framework, created by Rod Johnson and described in his book Expert One-on-One: J2EE Design and Development.1 It was created to address the complexity of enterprise application development. Spring makes it possible to use plain-vanilla JavaBeans to achieve things that were previously only possible with EJBs. However, Spring’s usefulness isn’t limited to server-side development. Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling.
Lightweight—Spring is lightweight in terms of both size and overhead.
Inversion of control—Spring promotes loose coupling through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for themselves. You can think of IoC as JNDI in reverse— instead of an object looking up dependencies from a container, the container
gives the dependencies to the object at instantiation without waiting to be asked.
Aspect-oriented—Spring comes with rich support for aspect-oriented programming that enables cohesive development by separating application business logic from system services (such as auditing and transaction management). Application objects do what they’re supposed to do—perform business logic—and nothing more.
Container—Spring is a container in the sense that it contains and manages the life cycle and configuration of application objects. You can configure how your each of your beans should be created—either create one single instance of your bean or produce a new instance every time one is needed based on a configurable prototype—and how they should be associated with each other.
Framework—Spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides much infrastructure functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.

Definition of Service-Oriented Architecture


A Service-Oriented Architecture (SOA) is a software architecture that is based on the key concepts of an application frontend, service, service repository, and service bus. A service consists of a contract, one or more interfaces, and an implementation.
APPLICATION FRONTENDS
Application frontends are the active players of an SOA. They initiate and control all activity of the enterprise systems.
It is always an application frontend that initiates a business process and receives the results.
SERVICES
A service is a software component of distinctive functional meaning that typically encapsulates a high-level business concept. It consists of several parts:
Contract. The service contract provides an informal specification of the purpose, functionality, constraints, and usage of the service. The form of this specification can vary, depending on the type of service. One non-mandatory element of the service contract is a formal interface definition based on languages such as IDL or WSDL.
Interface. The functionality of the service is exposed by the service interface to clients that are connected to the service using a network. Although the description of the interface is part of the service contract, the physical implementation of the interface consists of service stubs, which are incorporated into the clients[3] of a service and dispatcher.
Implementation. The service implementation physically provides the required business logic and appropriate data. It is the technical realization that fulfills the service contract. The service implementation consists of one or more artifacts such as programs, configuration data, and databases.
Business logic. The business logic that is encapsulated by a service is part of its implementation. It is made available through service interfaces. However, programming against interfaces is desirable, whether or not one applies a service-oriented approach.
Data. A service can also include data.

SERVICE REPOSITORY
A service repository provides facilities to discover services and acquire all information to use the services, particularly if these services must be discovered outside the functional and temporal scope of the project that created them. Although much of the required information is already part of the service contract, the service repository can provide additional information, such as physical location, information about the provider, contact persons, usage fees, technical constraints, security issues, and available service levels.

SERVICE BUS
A service bus connects all participants of an SOAservices and application frontendswith each other. If two participants need to communicatefor example, if an application frontend needs to invoke some functionality of a basic servicethe service bus makes it happen. In this respect, the service bus is similar to the concept of a software bus as it is defined in the context of CORBA. However, significant differences exist between these concepts. Most importantly, the service bus is not necessarily composed of a single technology, but rather comprises a variety of products and concepts.

Software Architecture

A software architecture is a set of statements that describe software components and assigns the functionality of the system to these components. It describes the technical structure, constraints, and characteristics of the components and the interfaces between them. The architecture is the blueprint for the system and therefore the implicit high-level plan for its construction.
(Enterprise SOA: Service-Oriented Architecture Best Practices)

May 16, 2007

Solving the error EJB with JBoss 4.04

Solved it with the following 3 steps:
1] Edit conf/jboss-service.xml and make CallByValue as 'true' in NamingService as below

name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
true


2] Edit deploy/ear-deployer.xml, and set Isloated and CallByValue as true

3]Edit deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml , and set Java2ClassLoadingCompilance and UseJbossWebLoader attributes as false

May 15, 2007

What is difference between Application server with Web server

A web server is a server designed to communicate with a web browser. Content includes text-based two-way communication with most of the com going from server to client. Data consists of text, formatting, graphics, sounds, and dynamic content.

An application server can be of several designs, but is basically a synchronous two-way sever that provides access to a single application shared among users through web-based or proprietiary methods. The content consists of data types, app commands, system commands, and data of complex types.

Typically, an app server provides a web-based platform for access to a database-driven application.