|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON Feature Delivering SOA
Delivering SOA
By: Doron Sherman
May. 20, 2002 12:00 AM
With the rapid adoption of Web services standards and increasing support for asynchronous and XML-based messaging in the J2EE specification (JMS, MDB, JAXM, JAXRPC), it's time to address the challenges involved in building business applications based on a service-oriented architecture. This evolution impacts current practices for Web application development, which now need to support this new paradigm. It also presents challenges for application deployment and management, commonly addressed today through proprietary enterprise application integration (EAI) solutions. In essence, the notion of a business application is evolving into "orchestration" of services, as the lines between development and integration become blurred. Service orchestration refers to the assembly of loosely coupled components and the coordination of multiple asynchronous conversations over coarse-grain communication protocols. Implementing orchestration logic in an application produces a consistent set of technical infrastructure requirements, such as managing non-linear state and long-lived application context, supporting parallel activities and sophisticated join patterns, handling exceptions and events generated by local and remote components, compensating for failed or cancelled business transactions, and graceful upgrading and management of application functionality. In this article, I present a sample application demonstrating the orchestration of services implementing a loan procurement business process. I'll describe the technical requirements for orchestration raised by the sample application and how an implementation can leverage the capabilities of the WebLogic Server. Then I'll describe a J2EE-based container for service orchestration that packages the common infrastructure requirements. Finally, we'll show how Java developers can program the orchestration logic of the loan procurement application using a Java-based abstraction.
A New Face for Application Development
Since that time, application development has evolved and matured, in large part due to standardization through the J2EE architecture. This architecture provides an extensible foundation for component-based development of business applications using server-side Java and has facilitated the delivery of self-service applications and user-facing portals into the mainstream. Until recently, these business applications have been characterized by synchronous request/reply interactions with an emphasis on the creation and delivery of dynamic Web pages (presentation), use of encapsulated building blocks (EJB), and connectivity to back-end data stores (e.g., JDBC). At the same time, organizations have still had to deal with the problem of connecting their information systems to one another, mostly using a variety of middleware technologies and proprietary EAI (enterprise application integration) tools. Even worse, this practice has typically remained separate from the mainstream application development domain and has normally been undertaken by consultants who possess specialized implementation skills. The methodology used for these implementations has continued to steer it away from that used for the delivery of mainstream business applications. However, the continued evolution of the enterprise computing platform and its rapid inroads into technologies such as XML Web services and asynchronous messaging is about to change all this.
Adoption of Web Services
Unlike earlier technologies, such as CORBA and DCOM, Web services are vendor-independent and provide true industry-standard interoperability. Web services can be deployed in various contexts, such as inside or across the firewall, using different transport protocols underlying SOAP (such as HTTP, SMTP, and JMS), and can be simple or composite, synchronous or asynchronous. Regardless of the context, Web services are accessible over SOAP and are introspected through their WSDL interface, making them interoperable. Most importantly, Web services provide for loosely coupled operation by separating the interface from the implementation. Thus, the consumer of a Web service need only rely upon the external contract describing the Web service, without assuming anything about its internal implementation.
The Need for Asynchrony
Using asynchronous messaging in a business application opens a range of opportunities for integrating loosely coupled components but also introduces significant new challenges when compared to a synchronous (RPC) programming metaphor. For example, when making an asynchronous call to an external component, the caller doesn't know how long it will take to execute. Therefore, a message correlation mechanism has to be put in place to be able to receive replies and match them to their original invocations. A conversation with a loosely coupled component may fail due to communication or component execution problems (at either end). Therefore, the application has to store its context at the start of the conversation and re-activate it from a persistent store upon completion of the conversation before executing subsequent application logic.
Publishing and Orchestrating Web Services
Orchestration, the second step in working with Web services, entails a more complex set of challenges. Orchestration of Web services involves making the services work together, as well as integrating them into an application. From a development standpoint, orchestration means assembly of loosely coupled services and coordination of the asynchronous conversations in which they are involved into manageable business applications. Experience with orchestration of services as part of a business application reveals a consistent set of infrastructure requirements that repeats itself across such applications. These technical requirements are described in our loan procurement example.
Loan Procurement Example
2. The orchestration logic (shown as a question mark) communicates with a customer information system (through a session bean) and with a credit rating application (through an asynchronous JMS call) to obtain the customer profile and a credit rating. 3. The orchestration logic routes any business exceptions that may be encountered to a customer support rep for manual processing of the application. 4. The orchestration logic then initiates two asynchronous conversations with trading partners UnitedLoan and StarLoan to obtain loan offers that will be presented to the customer as they become available. 5. Once the customer selects a loan offer, the orchestration logic obtains a loan policy from the selected provider and cancels the other loan requests. The loan policy is then issued to the customer. Let's summarize the primary issues involved in developing, deploying, and managing orchestration logic and the technical requirements that need to be addressed in the context of the sample loan procurement application described above.
2. State and context management: How do you coordinate, store, and manage the state of each conversation while utilizing asynchronous messaging? How do you correlate responses to the business transaction that initiated them? 3. Loosely coupled services: How do you model each conversation to allow for easy adoption of the application as business conditions change? How easily can you add a new loan processor or handle a change in interface? 4. Parallel processing: How do you design and coordinate parallel conversations (e.g., submit the loan application to UnitedLoan and StarLoan in parallel)? How do you implement sophisticated join patterns ("Cancel the conversation with UnitedLoan if the user selects the offer from StarLoan")? 5. Exception management: System- and business-level exceptions increase the variability and complexity of orchestration logic tremendously. What happens if UnitedLoan refuses to process the loan application because the information provided is invalid?
7. Open nested transactions: How do you combine multiple nonlinear conversations into a business transaction? How do you track the history of activities to allow for compensation, if necessary (since you can't roll back someone else's database...)? 8. Scalability and performance: What happens when the scope of the application increases and you need to support more services, more complex types of conversations, and a higher transaction volume? 9. Distributed administration: What happens if customer support decides to cancel a submitted loan application request? What happens if a change request occurs in the middle of a conversation? 10. Business visibility: How do you provide visibility into the state of the conversations? How easily can a business user obtain information on the number of loan requests processed per day or on a particular loan application? 11. Version control: How do you update the orchestration logic to reflect new business rules? How do you gracefully phase in new versions when 10,000 loan requests are pending? 12. Audit trailing: Can you trace the history of all conversations related to a specific loan request? Can you provide nonrepudiation for the application? Time-to-market and cost pressures, efficient utilization of available developer skills, and management of application delivery risks are the constant elements in the changing world of enterprise software. Similar forces were in effect during the mid-'90s when just about every company was hard pressed to deliver a dynamic Web presence to its customers. To address this need, the static content publishing medium was augmented with a Common Gateway Interface (CGI) that enabled publication of dynamic content on the Web. The delivery of simple Web applications that quickly grew in complexity introduced a common set of technical requirements. Developers found delivering those requirements in a custom, one-off fashion to be a significant impediment to cost-effective development and management of those applications. Session management, resource pooling (e.g., database connections) and multithreading, to name a few of these requirements, were then embedded in a new piece of infrastructure software that provided a compelling buy-versus-build option for IT decision makers and developers. This new piece of software, which became known as the application server, saved developers from repeatedly implementing (and maintaining) the same application infrastructure. Developers could now focus on authoring the application business logic, saving valuable time and increasing productivity. In addition, this class of self-service and customer-facing applications became easier to deploy and manage in production with the use of an application server. The CGI lesson, i.e. encapsulating application infrastructure and plumbing and enabling developers to focus on the application business logic, is directly applicable to the problem domain of service orchestration.
Extending J2EE into Orchestration
From JDBC to EJB
The widespread adoption of JDBC allowed a layer of data access components to be included in the J2EE application server, eventually standardizing as EJB component technology deployed using an EJB container and providing the underlying database access services and infrastructure. This evolution not only made coding at the JDBC API level unnecessary, but it also elevated the programming abstraction and enabled developers to focus on coding logic and avoid dealing with mundane application infrastructure and plumbing complexities.
The JSP Analogy
JSP technology allows Web developers and designers to rapidly develop, and easily maintain, information-rich, dynamic Web pages. JSP separates the user interface from content generation, thus enabling developers to alter page layout without changing the underlying dynamic content. This separation of page logic from UI design and display, and a reusable component-based design is made possible with the use of XML-like tags combined with Java scriptlets. With these features, JSP has simplified and accelerated the process of building Web-based applications.
The Impact of Messaging
The Orchestration Container
Leveraging WebLogic Server
The code for this article can be found on the Web at www.sys-con.com/weblogic/sourcec.cfm. Listing 1 shows the Scenario Bean source code for the example loan procurement application. Listing 2 shows the associated XML-based deployment descriptor for the JSB.
Conclusion
The illustrated solution is composed of an orchestration container that takes care of the infrastructure and plumbing requirements and a JSP-like abstraction that enables powerful, yet easy, authoring of orchestration logic by Java developers. Finally, the use of an orchestration container allows for versatile debugging, monitoring, reporting, and management of the resulting application. BEA WEBLOGIC LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||