| By Vladimir Shraibman, Konstantin Plotnikov | Article Rating: |
|
| December 25, 2006 03:30 PM EST | Reads: |
15,981 |
Over-Generalized Interfaces
Another interesting
trap is over-generalized interfaces. This trap has two popular
incarnations: CRUD (Create-Read-Update-Delete) and vertical industry
standards.
CRUD Web services describe generic operations over objects instead of specific business operations. CRUD interfaces are born out of the good intention to provide a single unified interface to all clients. CRUD operations also make it possible to generate a large part of the implementation skeleton using code generation tools.
To illustrate problems of CRUD interfaces, let's consider the case of a bank account. There could be operations to set account properties in a particular balance. A property might be updated only by an authorized request sender. While the CRUD approach looks very generic, it is difficult for implementation, use, and more importantly, security:
- On one hand, it is difficult to implement such a service. Security requirements are usually expressed for high-level operations. For example, some clients are permitted to deposit money, some to check an account, and others to withdraw. To check if a client is authorized to perform a low-level operation or update business data, the service has to guess what a high-level business action is and which is actually intended to be performed. Because authorization decisions are done inside methods, it is difficult to understand security policy without examining the operations implementation.
- On the other hand, the service is inconvenient for use by clients. They need to formulate high-level business operations in terms of low-level business data update operations. This also increases functional coupling between client and server, because the client has to know how the business operations affect business data. If the data schema is radically re-factored, it will be very difficult to write a proxy for the old interface. It is likely that all clients will have to be updated.
Of course, sometimes CRUD interfaces are adequate. For example, they could be used for communication between JavaScript code executed on a client and server side logic. Here, tight coupling between these two parts of the solution is rather natural. However, using CRUD interfaces for Web services is often the wrong idea.
Vertical Industry Standards
A less radical variant
of the previous trap is the use of a standard XML schema for business
domain messages. Pertinent examples of specifications here are OASIS
Universal Business Language and ACORD P&C. It may seem that such
standards reduce coupling between systems, but actually, their effect
on this aspect is not considerable or absent at all.
Often these standards declare a quite generic and flexible XML language that is able to accommodate different business requirements. However, the target service is usually able to understand only a subset of this rich language. Some constructs are valid for such a language and can be rejected by a Web service because they contain unsupported fields or miss required fields. UBL developers have noticed the problem and offered a partial solution in the form of customization guidelines.
If the schemata are used as is, implementation of both clients and servers is more complex. Servers are required to perform extra validation checks. Developers of clients are forced to check each step with additional guidelines to ensure that requests will be valid, instead of just relying on the respective API.
Although vertical industry standards can decrease documentation and interface development efforts, they often do little to reduce coupling of systems. Moreover, naive implementation of these standards can conceal existing coupling problems instead of solving them.
Fine-Grained Interfaces
There is a lure to make a
system too fine-grained, i.e., more fine-grained than actual business
operations. The primary motivation for this anti-pattern is to increase
the flexibility of the system and to reduce the volume of the traffic.
The system allows different invocation sequences, depending on what is
required by clients, so that a client's costs are proportional to his
needs.
This is a well-known bad practice that was understood as anti-pattern even during CORBA days. A typical example is expressing a high-level update operation as a sequence of property update operations. However, it still periodically surfaces because it falls into the exposing the application "as is" trap. The problem becomes a latency and perrequest cost of network operations that consume more resources than local operations.
When a business function is split into too-small pieces, the coupling also becomes higher because the business operation becomes implemented by client applications rather than by the server logic. This also leads to security problems similar to ones already discussed above in over-generalized interfaces.
Coarse-Grained Interfaces
There is an opposite
lure to make a system too coarse-grained, when several different
business functions are associated, because they are implemented by one
system.
ACORD P&C 1.x.x specification is an example of a specification in the domain of insurance. A single request can contain a number of business requests that create and update different business objects (claims, polices, etc). It is also possible to check the status of previous requests and pull results of completed operations. This is done to reduce the amount of interactions between clients and servers. Such an approach results in complex logic for request processing, and this complexity is caused not by the business domain of the specification, but by technical decisions to create a coarse-grained interface on the system and specify processing models for requests. As the result, the technical coupling in the system is increased since both clients and servers have to support the specified processing models.
Conclusion
RFC1925 says: "In protocol design,
perfection has been reached not when there is nothing left to add, but
when there is nothing left to take away" (http://ietf.org/rfc/rfc1925.txt).
Humans naturally strive for perfection. However, in the rush of adding
new application functionality and integrating existing applications,
this desire often stays unrealized. And to reach perfection, it is
required that managers, analysts, domain experts, and system architects
closely and confidingly work together because each of these roles deals
with only a piece of the whole puzzle.
Management is aware about the mission and the structure of their organization. Knowing needs, goals, and rules is the essential part of any change within an enterprise. Analysts and domain experts can elaborate these goals and rules to software requirements. Architects know how to bring these requirements to the life.
Coupling is an interesting and complex problem, which is created by decisions on many different levels. High coupling on the level of real business processes is often caused by management decisions. High functional coupling is often caused by the way requirements are distributed among applications, and it is mostly the responsibility of analysts and domain experts. High technological coupling is often caused by decisions made by architects.
While sometimes it is possible to partially compensate a problem of one level on other levels, it is still better to solve it on the level that it belongs to. RFC 1925 also says: "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead."
There are tools and methodologies that help to reduce coupling on each level. However human intelligence and creativity are still the best and indispensable tools.
Published December 25, 2006 Reads 15,981
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Vladimir Shraibman
Vladimir Shraibman is an analyst at Axmor. He has been working in the IT industry for more than 6 years as a programmer, software analyst and team leader. Vladimir was a member of Axmor’s team prepared a series of articles devoted to migration of J2EE applications from JBoss AS to Geronimo AS and IBM WebSphere Community Edition.
More Stories By Konstantin Plotnikov
Konstantin Plotnikov is a senior architect at Axmor Software, Russian software development company. Konstantin has been working with distributed applications since 1994, and has more than 14 years experience in the IT industry. During this tenure, he's been a programmer and software architect. He participated in JDO and JMI JCP expert groups.
- Kindle 2 vs Nook
- Is Cloud Computing Like Teenage Sex?
- GovIT Expo Highlights Cloud Computing
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Cloud Computing Can Revitalize Your Career as Software Developer
- Ubuntu-based Open Source Linux Mint Tests KDE Version
- Yahoo! SVP Shelton Shugar to Discuss Innovation at Cloud Computing Expo
- Virtualization Journal "Readers' Choice Awards" Voting Is Now Open
- Einstein, Sharks and Clouds: IT Security in the Cloud
- Adobe Flex Developer Earns $100K in New York City
- Virtualization Expo Call for Papers Deadline December 15
- Amazon Web Services Database in the Cloud
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Is Cloud Computing Like Teenage Sex?
- 1st Annual GovIT Expo: Letter from the Technical Chair
- Ulitzer News: Search vs New Media
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Confessions of a Ulitzer Addict
- GovIT Expo Highlights Cloud Computing
- Twitter, Linked In, Ning and Ulitzer: Easy Personal Branding Strategy
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- The i-Technology Right Stuff
- Linux.SYS-CON.com Exclusive: Linus Discloses *Real* Fathers of Linux
- After Ubuntu, Windows Looks Increasingly Bad, Increasingly Archaic, Increasingly Unfriendly
- Linus' Top Ten SCO Barbs
- A Closer Look at Damn Small Linux
- Netscape Co-Founder's 12 Reasons for Growth of Open Source
- Introducing "Cooperative Linux" - Linux for Windows, No Less
- *POINT - COUNTERPOINT SPECIAL* What's Wrong with the Open Source Community?
- Where Are RIA Technologies Headed in 2008?
- Linux.SYS-CON.com Exclusive: What Would UserLinux Look Like?
- i-Technology Viewpoint: The New Paradigm of IT Buying
- Is Linux Desktop-Ready Yet...or Not?





























