Home > Articles > Web Services > XML

Middleware: A History of Objects, Components, and the Web

Transactional Component Middleware (TCM) is the dominant technology today for transaction processing applications. This chapter will give the background on this technology and how it's used today in various functions.
This chapter is from the book

This is the second chapter in our historical survey of middleware technology.

All the technologies described in Chapter 2 have their roots in the 1980s. At the end of that decade, however, there was a resurgence of interest in object-oriented concepts, in particular object-oriented (OO) programming languages. This led to the development of a new kind of OO middleware, one in which the requestor calls a remote object. In other words, it does something like an RPC call on an object method and the object may exist in another machine. It should be pointed out at once that of the three kinds of middleware discussed in Chapter 2—RPC/transactional, message queuing, and remote database access—OO middleware is a replacement for only the first of these. (The interest in OO has continued unabated since the first edition of this book, leading to a wide understanding of OO concepts. We therefore do not feel it necessary to describe the basic ideas.)

A notable example of OO middleware is the Common Object Request Broker Architecture (CORBA). CORBA is a standard, not a product, and was developed by the Object Management Group (OMG), which is a consortium of almost all the important software vendors and some large users. In spite of its provenance, it is one of those standards (the ISO seven-layered model is another) that has been influential in the computer industry and in academia, but is seldom seen in implementations. (A possible exception to this is the lower-level network protocol Internet Inter-ORB Protocol (IIOP), which has been used in various embedded network devices.) One reason for the lack of CORBA implementation was its complexity. In addition, interoperability among vendor CORBA implementations and portability of applications from one implementation to another were never very good. But possibly the major reason that CORBA never took off was the rise of component technology.

The key characteristics of a component are:

  • It is a code file that can be either executed or interpreted.

  • The run-time code has its own private data and provides an interface.

  • It can be deployed many times and on many different machines.

In short, a component can be taken from one context and reused in another; one component can be in use in many different places. A component does not have to have an OO interface, but the component technology we describe in this book does. When executed or interpreted, an OO component creates one or more objects and then makes the interface of some or all of these objects available to the world outside the component.

One of the important component technologies of the 1990s was the Component Object Model (COM) from Microsoft. By the end of the 1990s huge amounts of the Microsoft software were implemented as COM components. COM components can be written in many languages (notably C++ and Visual Basic) and are run by the Windows operating system. Programs that wish to call a COM object don't have to know the file name of the relevant code file but can look it up in the operating system's registry. A middleware known as Distributed COM (DCOM) provides a mechanism to call COM objects in another Windows-operated machine across a network.

In the second half of the 1990s, another change was the emergence of Java as an important language. Java also has a component model, and its components are called JavaBeans. Instead of being deployed directly by the operating system, Java beans are deployed in a Java Virtual Machine (JVM), which runs the Java byte code. The JVM provides a complete environment for the application, which has the important benefit that any Java byte code that runs in one JVM will almost certainly run in another JVM. A middleware known as Remote Method Invocation (RMI) provides a mechanism to call Java objects in another JVM across a network.

Thus, the battle lines were drawn between Microsoft and the Java camp, and the battle continues today.

The first section in this chapter discusses the differences between using an object interface and using a procedure interface. Using object interfaces, in any technology, turns out to be surprisingly subtle and difficult. One reaction to the problems was the introduction of transactional component middleware. This term, coined in the first edition of this book, describes software that provides a container for components; the container has facilities for managing transactions, pooling resources, and other run-time functions to simplify the implementation of online transaction-processing applications. The first transactional component middleware was Microsoft Transaction Server, which evolved into COM+. The Java camp struck back with Enterprise JavaBeans (EJB). A more detailed discussion of transactional component middleware is in the second section.

One issue with all OO middleware is the management of sessions. Web applications changed the ground rules for sessions, and the final section of this chapter discusses this topic.

3.1 Using object middleware

Object middleware is built on the simple concept of calling an operation in an object that resides in another system. Instead of client and server, there are client and object.

To access an object in another machine, a program must have a reference pointing at the object. Programmers are used to writing code that accesses objects through pointers, where the pointer holds the memory address of the object. A reference is syntactically the same as a pointer; calling a local object through a pointer and calling a remote object through a reference are made to look identical. The complexities of using references instead of pointers and sending messages over the network are hidden from the programmer by the middleware.

Unlike in earlier forms of middleware, calling an operation on a remote object requires two steps: getting a reference to an object and calling an operation on the object. Once you have got a reference you can call the object any number of times.

We will illustrate the difference between simple RPC calls and object-oriented calls with an example. Suppose you wanted to write code to debit an account. Using RPCs, you might write something like this (We've used a pseudo language rather than C++ or Java because we hope it will be clearer.):

Call Debit(012345678, 100) ;    // where 012345678 is the account
                                // number and 100 is the amount

In an object-oriented system you might write:

Call AccountSet.GetAccount(012345678)    // get a reference to
    return AccountRef;                   // the account object
Call AccountRef.Debit(100);              // call debit

Here we are using an AccountSet object to get a reference to a particular account. (AccountSet is an object that represents the collection of all accounts.) We then call the debit operation on that account. On the face of it this looks like more work, but in practice there usually isn't much to it. What the client is more likely to do is:

Call AccountSet.GetAccount(X) return AccountRef;
Call AccountRef.GetNameAndBalance(....);
...display information to user
...get action to call – if it's a debit action then
Call AccountRef.Debit(Amt);

In other words, you get an object reference and then call many operations on the object before giving up the reference.

What this code segment does not explain is how we get a reference to the AccountSet object in the first place. In DCOM you might do this when you first connect to the component. In CORBA you may use a naming service that will take a name and look up an object reference for you. The subtleties in using objects across a network are discussed in more detail in the box entitled "Patterns for OO middleware."

Patterns for OO middleware

All middleware has an interface, and to use most middleware you must do two things: link to a resource (i.e., a service, a queue, a database), and call it by either passing it messages or call functions. OO middleware has the extra complexity of having to acquire a reference to an object before you can do anything. Three questions come to mind:

  1. How do you get an object reference?

  2. When are objects created and deleted?

  3. Is it a good idea for more than one client to share one object?

In general, there are three ways to get an object reference:

  1. A special object reference is returned to the client when it first attaches to the middleware. This technique is used by both COM and CORBA. The CORBA object returned is a system object, which you then interrogate to find additional services, and the COM object is an object provided by the COM application.

  2. The client calls a special "naming" service that takes a name provided by the client and looks it up in a directory. The directory returns the location of an object, and the naming service converts this to a reference to that object. CORBA has a naming service (which has its own object interface). COM has facilities for interrogating the register to find the COM component but no standard naming service within the component.

  3. An operation on one object returns a reference to another object. This is what the operation GetAccount in AccountSet did.

Broadly, the first two ways are about getting the first object to start the dialogue and the last mechanism is used within the dialogue.

Most server objects fall into one of the following categories:

  • Proxy objects

  • Agent objects

  • Entrypoint objects

  • Call-back objects

As an aside, there is a growing literature on what are called patterns, which seeks to describe common solutions to common problems. In a sense what we are describing here are somewhat like patterns, but our aims are more modest. We are concentrating only on the structural role of distributed objects, not on how several objects can be assembled into a solution.

A proxy object stands in for something else. The AccountRef object is an example since it stands in for the account object in the database and associated account processing. EJB entity beans implement proxy objects. Another example is objects that are there on behalf of a hardware resource such as a printer. Proxy objects are shared by different clients, or at least look as if they are shared to the client.

A proxy object can be a constructed thing, meaning that it is pretending that such and such object exists, but in fact the object is derived from other information. For instance, the account information can be dispersed over several database tables but the proxy object might gather all the information in one place. Another example might be a printer proxy object. The client thinks it's a printer but actually it is just an interface to an e-mail system.

Agent objects are there to make the client's life easier by providing an agent on the server that acts on the client's behalf. Agent objects aren't shared; when the client requests an agent object, the server creates a new object. An important subcategory of agent objects is iterator objects. Iterators are used to navigate around a database. An iterator represents a current position in a table or list, such as the output from a database query, and the iterator supports operations like MoveFirst (move to the first row in the output set) and MoveNext (move to the next output row). Similarly, iterator objects are required for serial files access. In fact, iterators or something similar are required for most large-scale data structures to avoid passing all the data over the network when you need only a small portion of it. Other examples of agent objects are objects that store security information and objects that hold temporary calculated results.

An Entrypoint Object is an object for finding other objects. In the example earlier, the AccountSet object could be an entrypoint object. (As an aside, in pattern terminology an entrypoint object is almost always a creational pattern, although it could be a façade.)

A special case of an entrypoint object is known as a singleton. You use them when you want OO middleware to look like RPC middleware. The server provides one singleton object used by all comers. Singleton objects are used if the object has no data.

Call-back objects implement a reverse interface, an interface from server to client. The purpose is for the server to send the client unsolicited data. Call-back mechanisms are widely used in COM. For instance, GUI Buttons, Lists, and Text input fields are all types of controls in Windows and controls fire events. Events are implemented by COM call-back objects.

Some objects (e.g., entrypoint objects and possibly proxy objects) are never deleted. In the case of proxy objects, if the number of things you want proxies for is very large (such as account records in the earlier example), you may want to create them on demand and delete them when no longer needed. A more sophisticated solution is to pool the unused objects. A problem for any object middleware is how to know when the client does not want to use the object. COM provides a reference counter mechanism so that objects can be automatically deleted when the counter returns to zero. This system generally works well, although it is possible to have circular linkages. Java has its garbage-collection mechanism that searches through the references looking for unreferenced objects. This solves the problem of circular linkage (since the garbage collector deletes groups of objects that reference themselves but no other objects), but at the cost of running the garbage collector. These mechanisms have to be extended to work across the network with the complication that the client can suddenly go offline and the network might be disconnected.

From an interface point of view, object interfaces are similar to RPCs. In CORBA and COM, the operations are declared in an Interface Definition Language (IDL) file, as illustrated in Figure 3-1.

03fig01.gifFigure 3-1 Object middleware compilation and interpretation

Like RPCs, the IDL generates a stub that converts operation calls into messages (this is marshalling again) and a skeleton that converts messages into operation calls. It's not quite like RPCs since each message must contain an object reference and may return an object reference. There needs to be a way of converting an object reference into a binary string, and this is different with every object middleware.

Unlike existing RPC middleware, the operations may also be called through an interpretive interface such as a macro language. There is no reason that RPCs shouldn't implement this feature; they just haven't. An interpretive interface requires some way of finding out about the operations at runtime and a way of building the parameter list. In CORBA, for instance, the information about an interface is stored in the interface repository (which looks like another object to the client program).

In object middleware, the concept of an interface is more explicit than in object-oriented languages like C++. Interfaces give enormous flexibility and strong encapsulation. With interfaces you really don't know the implementation because an interface is not the same as a class. One interface can be used in many classes. One interface can be implemented by many different programs. One object can support many interfaces.

In Java, the concept of an interface is made more explicit in the language, so it isn't necessary to have a separate IDL file.

So why would you think of using object middleware instead of, say, RPCs? There are two main reasons.

The first is simply that object middleware fits naturally with object-oriented languages. If you are writing a server in C++ or Visual Basic, almost all your data and logic will (or at least should) be in objects. If you are writing your server in Java, all your data and code must be in objects. To design good object-oriented programs you start by identifying your objects and then you figure out how they interact. Many good programmers now always think in objects. Exposing an object interface through middleware is more natural and simpler to them than exposing a nonobject interface.

The second reason is that object middleware is more flexible. The fact that the interface is delinked from the server program is a great tool for simplification. For instance, suppose there is a single interface for security checking. Any number of servers can use exactly the same interface even though the underlying implementation is completely different. If there is a change to the interface, this can be handled in an incremental fashion by adding an interface to an object rather than by changing the existing interface. Having both the old and new interfaces concurrently allows the clients to be moved gradually rather than all at once.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020