Industry Commentary
Code Reuse: From Objects to Components to Services
Code Reuse: From Objects to Components to Services
Dec. 3, 2001 12:00 AM
Now that the age of limitless optimism is over and it's trendy to be cynical, I hear many Web services cynics remark that there's nothing new here. They're just components. Been there, done that, and in fact we called it CORBA (or COM). This leads to the inevitable questions about what truly is new and different, and what is empty hype for yesterday's news.
In the Beginning...
Once upon a time, programmers analyzed their needs, wrote code, and solved their problems. Life was good. Then scientists discovered the object and promised code reuse and shorter development cycles. C++ was the legend of the day...except for two problems: C++ was hard to use and the compiled objects were proprietary. So scientists went back to work and discovered the component. Code reuse and short development cycles forever! Except for two things: components are hard to use and are proprietary.
After that, scientists probably spent a fair amount of time playing games on the Web. But they did eventually tear themselves away and emerged with a new form of reusable code called the Web service. Yes, much of the same verbiage we heard in the past, but there are two things that Web services is getting credit for: being an industry standard and being (somewhat) easier to use.
While component models were busy finding their place in the industry, a parallel effort was taking place. The W3C established itself as the organization dedicated to making the Internet technology, and the Internet became recognized as a part of one's infrastructure, causing an intersection of these two endeavors. So is this code reuse strategy that much different from its predecessors?
The Differences - A Linear Trend
One of the points of confusion about Web services is not so much what they are (read the specs), but rather when to use them. Technically, Web service technology can be used to facilitate every level of interoperability, from a single line of code to an entire ASP application, but that would be violating the most popular adage: use the right tool for the job. Much of how Web services fits into the bigger picture can be derived from examining the trends.
Larger level of granularity: One thing that objects, components, and services have in common is that they're all reusable blocks of code. But one clear trend is that the size of the block is growing. Applications (especially e-business applications) are larger and stretch across more pockets of functionality, and middleware is evolving to support that. Typically, components are larger than objects, and services are larger than components. Often the effort put into understanding someone else's code is costlier than rebuilding it, but as the size of the reusable block of code grows, the trade-off balance shifts.
Reduced effort required to reuse code: C++ users rely on inline comments, old design specs, or lunchroom chatter to effectively share objects, but Web services have help for this step built in. Besides standard interfaces, there's UDDI and WSLD to find and discover services. Services are striving to reach the nirvana of productive cooperation between strangers. Perhaps we've crossed the threshold where reusing code requires less of an investment than writing it.
Breadth of scope: With each generation of reusable objects, the reach extends farther and farther. This is in part due to the size and ability to access more and more diverse assets, but services makes a large jump by being able to cross the Internet and by being an industry standard.
Increased focus on information: In today's interaction of services, the payload gets the spotlight. Sending business documents and sharing information is often the focus of e-business applications. Until the invention of XML, data sharing required both the sender and the receiver to know exactly what was to be transferred and how to read and process it. This had to be hard-wired into the application, greatly reducing flexibility. Self-describing XML fundamentally changes how services can share information and has taken code reuse to the next level.
Because all these changes are linear, one could argue that nothing is truly new since the days of the first object-oriented programming language (and even that could be seen as a logical derivation from earlier technology, but I don't want to date myself). In fact, Web services are really just the original vision with more of the bugs worked out. On the other hand, some of the steps that have been taken are giant steps.
CORBA and COM: Could It Have Been You?
Perception vs Reality
So, could some of the component models have evolved to capture the glory that swirls around Web services? Technically, they could have added support for XML and the ability to cross the firewall, and many have. But there are two other problems.
First is the issue of being proprietary versus being an industry standard. The only difference between the two, of course, is the number of people sharing the opinion, so this is more perception than reality. The other is ease of use. While Web services are certainly easier to use than traditional components, they're not as easy to use as HTML. Since Web services standards are so tightly associated with HTML and the W3C, the perception gives services an extra edge.
Looking Forward
Will these trends continue? Absolutely. Apps will continue to grow and reuse will continue to be simplified, all driven by businesses' need to be agile. Many of the known "bugs" in the system, like security, monitoring, billing, and workflow, will be tackled and solved in time. The trajectory, however, will remain the same: easier and more productive reuse of existing assets.
About Coco JaenickeCoco Jaenicke was, until recently, the XML evangelist and director of product marketing for eXcelon, the industry's first application development environment for building and deploying e-business applications. She is a member of XML-J's Editorial Advisory Board.