1 Introduction to EC

1.4 EC principles

In this section, we look into more details about middleware, SOA, application architecture, and component-oriented programming. These are the principles for EC system and application design, implementation, and deployment.

1.4.1 The concepts of middleware

What is middleware?

Middleware is a software layer that is placed above Operating system or networking layer and below the application layer. Fundamentally, it provides services to transfer data between programs in a distributed environment hiding the details of communication protocols, OS and hardware. It also provides extended services such as data management, application services, messaging, authentication, and API management.

The role of middleware is similar to that of OS between hardware and applications. For example, when we write a C program to save application data to a file, we use stdio library functions like fopen, fprintf, and fclose. These functions call OS system calls to access the disk. Here the system calls are services provided by the OS, the stdio functions provide APIs that we used for file I/O in application programming.

Why using middleware in EC?

The essential role of middleware is to provide an environment to manage the data exchanges in complex, heterogeneous and distributed systems. Enterprises use a variety of heterogeneous systems and applications in businesses operations. Heterogeneous systems use different technologies and run on different platforms, e.g. Java platforms, .NET platforms. The middleware technologies provide a solution to glue the systems together.

In enterprise information system development, new components are often added to the existing systems and some old components may be outdated and have to be removed. It also needs to integrate some legacy systems. Middleware plays a critical role in integrating legacy systems and newly adopted components and applications. It makes the development both economically and practically feasible.

The benefits of using middleware include:

  1. Re-usability and portability: Middleware technology helps to make use of old legacy systems and application. It also helps to export and reuse newly developed components in new applications, such increases the portability of an application and improves the reliability of the system.
  2. Efficient and cost effective: Middleware can help developers to build applications efficiently. It takes less time and cost to configure or develop business logic components by reusing existing components. Middleware can also help developers, architects, IT managers, and business leaders automate manual decisions. That in turn improves resource management and overall efficiency and reduce cost.
  3. Seamless heterogeneous integration: Using middleware makes interaction between heterogeneous systems and application cost-effective and efficient.

What does EC middleware consist of?

EC Middleware wraps some fundamental operations in EC applications and provides them as services. The following are the three primary service modules used by EC applications.

  1. Transactional Middleware (TM): Also known as Transaction Processing Monitor (TP). TM coordinates request between clients and servers. TM supports N-tier structure and load balancing. TM manages transactions over multiple databases.
  2. Message-Oriented Middleware (MOM): Also known as message servers, is a middleware to provide message communication services for distributed systems. It sends messages to recipient programs that interprets these messages and takes appropriate action.
  3. Object Oriented Middleware (OOM): OOM provides communication services between two components including object look-up, remote method invoking with in synchronous communication, and synchronous communication through messaging. OOM also support transactions.

Common tools for middleware

The following parts and tools are commonly included in EC middleware.

  1. Web servers: Web Server processes the requests and delivers it to the client. Web server uses web services that are one of the most advanced and promising way to integrate systems. Web Services works over web (or Internet) and communicate with programs via Internet protocols like Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP). It is one of the most flexible options for integration and supports both RPC and MOM systems.
  2. Application servers: This is the software on which business logic components are deployed and hosted.
  3. Application deployment tool: This is a middleware tool to delivery and install and un-install application components on application servers or web servers.
  4. Enterprise service bus: This is a middleware tool used to distribute work among connected components of an application.

1.4.2 Concepts of SOA

Service-Oriented Architecture (SOA) is an architectural style to design, develop and deploy a group of applications that share some common services. SOA facilitates the development of modular business services that can be easily integrated and reused, thus creating a flexible and adaptable infrastructure.

SOA defines a way to make a software component reusable by making it as a service with service interfaces, so that the service can be called by other services or application components. The service interfaces provide loose coupling, they can be called with little or no knowledge of how the integration is implemented underneath.

SOA services can be built from scratch but are often created by exposing functions from existing systems with new service interfaces. Each service in an SOA embodies the code and data required to execute a business logic function. The service interfaces use common communication standards so that they can be incorporated into new applications effectively. For examples, SOA services are often exposed as Web Services using standard network protocols such as SOAP (simple object access protocol) or JSON to for service call. They are published to let developers find them and reuse them to assemble new applications.

Advantages of using SOA include:

  1. Reduce development time : SOA services are easily reused and can be rapidly assembled into new, composite applications.
  2. Lower cost: Reusable services reduce the number and internal complexity of enterprise services. Standardized services know how to work together, enabling disparate applications to quickly and easily connect.
  3. High-quality services: Increased service reuse creates high-quality services through multiple testing cycles from different service consumers. Fewer, reusable services provide greater control over corporate and IT governance policies, and reduce the overall compliance risk to an enterprise.

Middleware & SOA

SOA services are usually built on top of middleware, using the services provided by middleware and deployed on middleware web servers or application servers. On the other hand, the architecture of middleware software system is of SOA. SOA is for application design. Middleware focuses on the runtime environment to run applications.

1.4.3 Multi-tier architectures

In software engineering, multi-tier architecture (also called n-tier architecture or multi-layered architecture) is a client-server architecture in which components of different purposes (e.g., presentation, application processing, and data storage) are logically/physically separated.

The terms layer and tier are often used interchangeably. However layer is a logical structure view, and tier is a physical structure view. When tier is used, components of different tiers can be on different machines.

The n-tier architecture provides a model by which developers can create flexible applications using existing components, services, local and remotes. For example, Figure 1 shows the 4-tier architecture/model of enterprise applications. It is composed of client tier, presentation tier (web tier), application (business) logic tier, and data tier. The presentation tier (web tier), application (business) logic tier, and data tier are on server side, which are often viewed as 3-tier model when the sever side is concerned.

Figure 1: 4-tier model. Created by Dr. H.Fan, used with permission.
Figure 1: 4-tier model. Created by Dr. H.Fan, used with permission.

An integrated enterprise information system needs to support multiple n-tier applications. SOA and middleware provides a platform to run multiple multi-tiered applications. That is, components of tier of applications are deployed to run on middleware runtime on different machines and provides service interfaces. A multi-tiered application is built on these components. Components can be shared by different applications.

1.4.4 Concepts of Components

We have used the term component (or software component) many times. What is a component?

In the book, Component Software: Beyond Object-Oriented Programming (2002) Clemens Szyperski describe it as “A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties”.

Conceptually, a component is a composition entity of a system or application with the following basic properties.

  1. Has interfaces to be used by other components.
  2. Has dependency context for using other components.
  3. Can be deployed independently on a runtime environment (container or application server)
  4. Can be assembled to create objects being used by applications. A component is instanced to an object at runtime after assembling dependency components.

The dependency of two components is defined by their interaction relation. Component A depends component B if B is used in A. The interaction is typically a procedure call of B in A. If A and B are on different machines or A cannot access B directly. Then A needs to make remote procedure call of B. This involves following basic steps.

  1. Component A connects the host of component B.
  2. Component A sends a request to find the component B.
  3. If found, component A sends a request to call component B’s procedure.
  4. Component B sends the result of procedure call to component A.

The communication between two components is referred to as inter-component communication. The inter-component communication is usually done through middleware services. Component models are technologies introduced to simplify the processing of component programming.

1.4.5 Component models

A component model defines the properties and methods that components must satisfy, the mechanisms for the composition of components. Several component models have been developed, e.g., Common Object Request Broker Architecture (CORBA) component model, Enterprise JavaBeans (EJB) model, Microsoft developed Distributed Component Object Model (DCOM). (supplementary link).

CORBA

CORBA is a standard defined by the Object Management Group (OMG) to facilitate the communication of components that are deployed on diverse platforms. CORBA enables collaboration between systems on different operating systems, programming languages, and computing hardware. CORBA uses an object-oriented model, distributed object paradigm. CORBA is language independent, and capable of handling a variety of object life cycles. CORBA provides the foundation for component model.

DCOM

DCOM was developed by Microsoft in late of 1990s to address large, complex and distributed enterprise applications. DCOM is a Microsoft proprietary technology for communication between software components on networked computers. DCOM was further evolved to COM+, which was integrated into .NET framework. This paper provides a side-by-side comparison between CORBA and DCOM (supplementary link).

Enterprise JavaBeans (EJB)

EJB is Sun’s component model. EJB defines server-side components that encapsulates business logic of an applications. EJB uses Java Remote Method Invocation (RMI) for remote method call. RMI is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java objects and distributed garbage-collection. (supplementary link).

EJB container provides a runtime environment for EJB components. It provides services for EJB component operations such as transaction, security, persistence. EJB is the core part of Java platform Enterprise Edition (Java EE).

Interoperability

Interoperability refers to the ability of inter-component communications between components of different component models. Components by CORBA, DCOM and EJB cannot communicate each other directly. Solving this problem, a standard web service interface is introduced, e.g. Simple Object Access Protocol (SOAP) allows one component to access another component.

1.4.6 Component-oriented programming

You may have learned a few programming paradigms (styles) such as procedural programming, and objected-oriented programming. In this subsection, we look into the concepts of component-oriented programming.

Procedural Programming (PP)

We learned the concepts of PP when studying data structures and/or C programming language. In PP, we write a group of functions including the main function. Each function contains a sequence of statements. A statement may call another function. Program execution starts from the main function. We also learned **Functional programming (FP)*, a special case of PP, in which functions are pure functions, namely avoid changing state and mutable data.

Object-Oriented Programming (OOP)

We learned OOP in Java or C++ programming. Object is the subject OOP works on. In OOP, we define objects by classes. A class may define data fields (also called properties or attributes), and methods (functions or procedures in PP). An object is instanced in memory at the runtime. The execution of an OOP program starts from a main function, in which objects are instanced and object methods are invoked. A method invoking may contain another object method invoking, such that the execution of an OOP program jumps from objects to objects by method invoking.

With PP and OOP, we typically create a runnable program for an application. For example, in C programming, we write source code in C, and use compilers to convert the source code programs to an executable programs, and run them on supported processors. In Java programming, we use Java compiler to convert Java source code programs to bytecode programs, and run them on Java virtual machines.

Component-Oriented Programming (COP)

COP is a programming paradigm to design and implement components, to build applications by combining components, and to deploy applications. COP was introduced to deal with the complexity of multi-tier enterprise applications.

COP delivers a program component, which can be loaded or installed on a middleware container or application server. The component exists as a service with given interfaces. It can be found by look-up, and its called by local and remote components.

A COP application typically contains many components connected in certain topology specified by the application. One component, serves as an entry component, where an initial service request starts by a procedure call. The procedure call invokes a procedure call of another components along the topology of the application. The data transfers between components along the topology is called the data flow the application. Usually the entry component is a client program, running on servers, desktops, or mobile devices.

COP focuses on components and deals with data objects, procedures, dependent components, interfaces, and deployment. Deployment is technology dependent, but generally, it needs packaging, configuration, package transfer and install, dependency resolving, and component instancing and dependency injection.

COP vs OOP

With COP, applications are often modeled as dependency of components. It uses component interfaces and dependency injection to reuse existing code. This is the black-box reuse model, which allows developers to use existing components without knowing its internals.

With OOP, applications are often modeled as complex hierarchies of classes, which are designed to approximate as closely as possible the business problem being solved. It reuses existing code by inheriting it from an existing base class and specializing its behavior. This form of reuse is commonly known as white-box reuse.

However, OOP are used in COP for data objects and procedures.

COP advantages

  1. COP reduces the time and cost in application development. Using available verified in-house or third-party components to build new applications avoids reinventing the wheel, and assures the quality.
  2. COP makes applications maintenance easy. It allows to modify a component without changing other components. A component can be updated at runtime, as long as the components aren’t currently being used. The improvements, enhancements, and fixes made to a component will immediately be available to all applications that use that component.
  3. COP makes applications flexible to extend. It allows to create and deployment new components, which may dependent on existing components, but not need to change existing components.

1.4.7 Summary

In summary, PP, OOP, COP are the results of evolution of programming technology to address the increasing complexities of computing applications. OOP is an extension to PP, and COP is an extension to OOP by adding features for RPC/RMI and deployment. Choice programming style depends on application problems. For large, complex, and distributed EC applications, COP is the top choice.

We will study and practice COP with Java EE, use JBoss-AS (WildFly) as application server (middleware) for component/application deployment. In addition, we will also look into Spring framework in Lesson 7 and OSGi framework in Lesson 8 for alternative EC platform solutions.

References

  1. Middleware descriptions from Rad Hat.
  2. Oracle Fusion Middleware, document.

1.4.8 Exercises

Self-quiz

Take a moment to review what you have read above. When you feel ready, take this self-quiz which does not count towards your grade but will help you to gauge your learning. Answer the questions posed below.

Go back