Book Image

Applied SOA Patterns on the Oracle Platform

By : Sergey Popov
Book Image

Applied SOA Patterns on the Oracle Platform

By: Sergey Popov

Overview of this book

Table of Contents (16 chapters)
Applied SOA Patterns on the Oracle Platform
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
An Introduction to Oracle Fusion – a Solid Foundation for Service Inventory
7
Gotcha! Implementing Security Layers
Index

Preface

Arguably, distributed computing is the most complex concept in computer science. The practical realization of this concept in the form of service-oriented computing further adds to this complexity. Generally, there are two reasons: firstly, because of a compound architectural approach, SOA is based on already complex techniques, and secondly, to stay on the cutting edge of computing technology, SOA must appeal to non-IT businesses to be successfully adopted in modern enterprises. To achieve this goal of successful adoption, SOA architects must combine a vendor-neutral approach to systems design with a deep knowledge of platforms on which the solution will be realized. This combination will allow service-oriented solutions to be flexible and resilient at the same time.

Maintaining the right balance of these two success factors is quite a challenge in the multilayered, multiframework, and compound environments of SOA. Since there are several success factors with a magnitude of problems associated with their implementation, SOA adoption requires a structural and pattern-based approach. In this book, our task is a practical demonstration of pattern-oriented problem solving based on the concrete implementation of service collaboration and integration systems in different industries (telecom, shipping, and logistics). The book goes for the most complex and, at the same time, the most common use cases. Conceivably, the most challenging problems in SOA are related to dynamic service compositions, usually assembled on runtime and in a business-agnostic way. This is the ultimate realization of the SOA Composability principle. This principle is, in turn, the foundation of the main service-orientation promise: keeping businesses agile and adaptive to any type of environmental shifts by assembling new compositions (that is, business processes) out of existing atomic services.

The general approach to achieve this, also used in every chapter of this book, is as follows:

  • Find the root cause of the problem and analyze it in strong relevance to the SOA design principles.

  • Speculate the decomposition of the problem into smaller, more manageable parts that could be implemented as separate atomic components or services.

  • Identify the ways of standardizing the decomposed components/services, focusing on the improvement of their reuse.

  • Propose various vendor-neutral solutions (not exactly Oracle) based on the identified components/services and, again, diligently analyze them using the SOA design principles, focusing on the desired SOA characteristics.

  • Present the most optimal solution based on an Oracle platform and compare it to other alternatives proposed during the analysis phase. Since we are vendor-neutral and focus primarily on the preferred solution's characteristics, we cannot guarantee that Oracle realization will always win, but it will be the closest bet for most of the discussed use cases.

In order to make the first step (the problem analysis) consistent, verifiable, and undisputable, in Chapter 1, SOA Ecosystem – Interconnected Principles, Patterns, and Frameworks, we introduce you to the SOA principles and the areas of their application. It is important to see these principles interconnected as their relations are not always straightforward and we should be very careful in balancing them in different frameworks and service layers. Some key SOA standards will also be discussed with the focus on those employed in the composition controllers design.

Logically, following the architectural two-folded task, after discussing the vendor-neutral SOA aspects, we look at the Oracle product's portfolio and see how it can help us in achieving the goals of service orientation. The introduction to the characteristics of Oracle Fusion Middleware will help us in the chapters to follow, when building practical solutions around Agnostic Composition controllers for different companies. Importantly, we will not jump into Oracle realization at the very beginning of every chapter (this part is dedicated to a certain SOA framework). Instead, we will look very closely at every alternative, check its feasibility, and see how common solutions (in the form of patterns) can help us in mitigating common problems for these frameworks.

What this book covers

Chapter 1, SOA Ecosystem – Interconnected Principles, Patterns, and Frameworks, sets the tone for the entire book, presenting the main SOA frameworks in relation to individual SOA characteristics and goals. To achieve these goals, we will discuss the SOA design principles, their dependencies, and roles in maintaining a robust SOA ecosystem. For a better understanding of the importance of these principles, we will start by presenting a practical and quite realistic use case, depicting the disaster that may follow when design principles are sacrificed to achieve short-lived tactical goals. These problems will be further analyzed during the course of this book and individual SOA patterns will be offered as proven solutions within every individual SOA framework. The practical outcome of this chapter will present you with a complete set of SOA frameworks and SOA Service Inventory patterns, which help shape the Service Inventory according to the presented frameworks.

We suggest that everyone, even seasoned veterans familiar with the concept of service orientation, begin with this chapter. Here, we establish the glossary and architectural vocabulary, essential not only to understand further material but also for your day-to-day technical communications. This chapter also sufficiently presents fundamental materials to prepare for the Certified SOA Professional examinations (http://www.soaschool.com/certifications/professional).

If you are an Oracle practitioner and familiar with the modern Fusion Middleware stack, you can skip the next chapter and proceed directly to service composition patterns, described in Chapter 3, Building the Core – Enterprise Business Flows, and Chapter 4, From Traditional Integration to Composition – Enterprise Business Services. If you already have hands-on experience with Agnostic Composition controllers and dynamic service invocation, we suggest that you first read Chapter 5, Maintaining the Core – the Service Repository, which explains the role of reusable service artifacts and Service Repository in runtime discoverability.

Chapter 2, An Introduction to Oracle Fusion – a Solid Foundation for Service Inventory, provides a list of Oracle products (OFM stack) and methodology(Oracle AIA+FP with Foundation Pack) that fit the pattern/frameworks matrix, presented in Chapter 1, SOA Ecosystem – Interconnected Principles, Patterns, and Frameworks. This chapter explains the roles of the tools and the Oracle roadmap in support of the SOA principles. Most importantly, it explains how Oracle products support SOA WS-* standards (WS-ReliableMessaging, WS-Coordination, WS-BPEL, WS-Addressing...) and how this fact aids in pattern implementation. Information from this chapter will help architects in setting realistic requirements and composing a proper RFI matrix for Oracle products in relation to the SOA frameworks.

Chapter 3, Building the Core – Enterprise Business Flows, first presents the SOA platform's refactoring initiative, undertaken in a large-scale telecom enterprise, aiming for the optimization of a complex multinational Service Inventory. Traditionally, the first target is complex long-running processes, most commonly, those based on BPEL. Oracle SOA Suite is perhaps the most mature tool for this job, but it is still widely misinterpreted by many developers and architects. This chapter will explain how to maintain the right balance using the four SCA components, minimize pressure on the BPEL dehydration store, achieve optimal performance, and improve agility of the composition logic using the Agnostic Composition controller. The chapter's practical outcome will be the Service Broker, suitable to handle dynamically synchronous and asynchronous service compositions.

Chapter 4, From Traditional Integration to Composition – Enterprise Business Services, continues discussion of the Telecom primer started in the previous chapter by addressing the separation of the concerns principle and untying the Agnostic Composition controller from the Orchestration platform and Enterprise Service Bus. This chapter will demonstrate how to build business-agnostic composition controllers on OSB to dynamically route messages and coordinate transactions in a reliable manner for synchronous and fast-running services. The roles of all ESB-related SOA patterns are explained in great detail.

Chapter 5, Maintaining the Core – the Service Repository, demonstrates how to design, collect, maintain, and access service metadata from the very beginning of the SOA project until the service is decommissioned at the end of the lifecycle. You will be presented with a lightweight service taxonomy, essential to maintain the service composition logic in the composition controllers designed in previous chapters. From a broader perspective, this chapter sets the basis for effective SOA Governance, presenting all SOA Foundational Inventory patterns and their implementation using Oracle Service Repository and Registry. The DB realization of a flexible service taxonomy will be the practical outcome of this chapter.

Chapter 6, Finding the Compromise – the Adapter Framework, discusses ways to balance and optimize the adapter framework in Enterprise Service Inventory. Oracle has the most advanced adapter framework for applications, protocols, and resources. This chapter will demonstrate what frameworks and tools (OSB or SCA) are the best candidates for patterns implementation and how to avoid the most common mistake, creating hybrid services. We also discuss in considerable detail ways to avoid adapters as a non-SOA approach through interface standardization.

Chapter 7, Gotcha! Implementing Security Layers, explains how services can be designed in a secure way from the very beginning. The core aspects of service security design are highlighted, starting from vulnerabilities and risk analysis to common attack types and risk mitigation methods. These aspects are presented from the attacker's and security architect's sides; the SOA Security pattern's role is demonstrated from components up to the Security Gateway levels.

Chapter 8, Taking Care – Error Handling, completes the Agnostic Composition controller design, started in Chapter 3, Building the Core – Enterprise Business Flows. Here we will demonstrate how complex recovery scenarios can be implemented using the standard Oracle Fault Management framework and custom composition controllers, acting as automated recovery tools. With the focus on proactive service monitoring and error prevention, we will discuss the SOA patterns that can contribute to one of the most complex SOA problems—recovery of the composite business service composed agnostically.

After completing the preceding chapters and gaining some practical experience in SOA implementations, you will be equipped to attain the Certified SOA Architect level (http://www.soaschool.com/certifications/architect).

Chapter 9, Additional SOA Patterns – Supporting Composition Controllers, concludes the book by presenting complex SOA patterns, realized on very interesting Oracle products: Coherence and Oracle Event Processing. Combined in line with the SOA patterns and enhanced by the business monitoring tool (BAM), these products present a new Oracle approach in the event-driven architecture—fast data. Using a logistics example, we will discuss how an event-driven network approach and Oracle CQL can improve data processing and business decision services in complex distributed environments.

What you need for this book

To implement solutions based on the examples in this book, install Oracle SOA Suite 11g Patch Set 6 (11.1.1.7). Also, for Chapter 4, From Traditional Integration to Composition – Enterprise Business Services, and Chapter 6, Finding the Compromise – the Adapter Framework, Oracle Service Bus (11.1.1.7) is needed. Oracle DB 11g (or 12c) is a prerequisite for any installation, but it will be used as a standalone tool for examples discussed in Chapter 5, Maintaining the Core – the Service Repository, and Chapter 6, Finding the Compromise – the Adapter Framework. A better understanding of the concept of Enterprise Service Repository, Oracle SR 11g, and Registry would be useful in Chapter 5, Maintaining the Core – the Service Repository. Oracle API Gateway (formerly, Oracle Enterprise Gateway, Release 11.1.2.2.0) is discussed in Chapter 7, Gotcha! Implementing Security Layers, and you could have it installed (optionally) to better understand the security patterns discussed in this chapter.

Who this book is for

Some say experience is something you don't get until you stop needing it. This book is what an established professional of today would have wanted to read at least ten years ago. Here you will find my combined experience of at least 15 large-scale service-oriented projects in three industries. Successful implementations were recognized by not only clients, but also Oracle. I really admire the skills and ingenuity of professionals who have worked together on the implementation of the described concepts. I believe that the presented materials will be useful for experts working at different levels:

  • SOA architects working on Oracle products—from the solution to enterprise levels—will get a comprehensive guidance on how to apply an SOA practice on the Oracle platform.

  • SOA architects practicing the vendor-neutral approach (although Java is not purely neutral anymore) will find enough materials on patterns, methods, and realizations of efficient and low-cost solutions for small- and mid-sized enterprises.

  • SOA DevOps team leads will learn how to manage Oracle Fusion projects using both the Agile or Waterfall methodologies. Code snippets presented in the book are more than enough for developers to get going with their own implementation.

If you are looking for study materials on the SOA architecture to pass the vendor-neutral exams (such as SOACP SOASchool; http://www.soaschool.com/), this book should be sufficient to attain the Certified SOA Architect status. In fact, having the Certified Trainer status, we were asked several times to prepare for combined SOA school lectures, which condensed SOA architecture, analytics, and security courses into a one-week intensive training for experienced architects. In many aspects, Applied SOA Patterns on the Oracle Platform is the lecture material we use for these purposes. We should also mention that we use these materials actively in our day-to-day activities.

Please bear in mind that despite the numerous technical examples, this is not a Cookbook or Programmer's Guide (such as http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book). You can find plenty of them for every Oracle product we use in this book on the official Packt Publishing website. For a better understanding of the presented materials and examples, you must be familiar with the SCA concept (in particular, BPEL and Mediator), Rule Engines, and Oracle Service Bus (the implementation of proxies is a must). The common prerequisites include some Java skills (EJB and Servlets), XML, and PL/SQL. Nevertheless, we strive to present all the concepts in the most comprehensive manner and you will find plenty of references to the Oracle documentation and best practices.

Staying focused on the Agnostic Composition controllers, we had to rationalize the set of tools, excluding some really interesting ones such as Oracle BPM Suite. Unfortunately, it's virtually impossible to put all Oracle products from the Fusion Middleware stack into a single book; please see related books on the publisher's site.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The xsd:any element is at the upper level in this hierarchy; it has an equivalent object in OOP."

A block of code is set as follows:

Public SearchObject getSearchResultObject() throws Exception {
   try{
       InputStream source    = getResultStream(search_url);
       Reader reader         = new InputStreamReader(source);
       Gson   gson           = new Gson();
       SearchObject response = gson.fromJson(reader, SearchObject.class);
       reader.close();
       return response;
    }
    catch (Exception e){
      log.error(getClass().getSimpleName(), "Error for URL " + search_url, e);
    }
    return null;
 }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

//invoking parser
 execute immediate BEGIN '||v_parser||'(:1, :2, :3, :4 ); END;' USING IN ip_lob, IN v_msgid, OUT v_status, OUT v_status_text;

Any command-line input or output is written as follows:

loadjava -grant public –user <xdbuser>/<xdbuserpwd>@<XDBSID> CustomServlet.class

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "The CTUMessage payload is our generic message container."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: https://www.packtpub.com/sites/default/files/downloads/0563EN_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.