Wednesday, November 26, 2008
Complex Event Processing
CEP is a natural fit with business process management, like Active Endpoint’s line of BPEL engines. For those that don’t know, Active Endpoints is a partner of XAware, as data services created in XAware fit nicely as the data layer in a BPEL process. With Active Endpoint’s integration with CEP, events are automatically generated for each step in a BPEL process. Then, the CEP query language enables operators, analysts, and developers a means to easily and flexibly evaluate the event stream, identifying important trends or critical compositions of related events. This really seems to be a neat technology that I think will gain traction in the future.
For further investigation, I'd recommend looking at the Esper project, a commercial open source project located at http://esper.codehaus.org/.
Wednesday, October 29, 2008
Services for RIA
The idea of using a services layer to supply information and operations to a web client application is not new. While I’ve written about the combination, I certainly am not the first to recognize the nice fit. Some of the acronyms floating around the internet, and the AJAXWorld conference were SOFEA (Service Oriented Front End Architecture) and SOUI (Service Oriented User Interface). SOFEA was coined by Ganesh Pradad and a couple coworkers in October, 2007, in a paper titled “Life Above the Service Tier” (http://sofea.googlegroups.com/web/Life+above+the+Service+Tier+v1_1.pdf). Ganesh’s blog (http://wisdomofganesh.blogspot.com/), which is high on my favorites list, contains additional information and resources.

SOFEA recommends a clear separation of presentation tier concerns. The major processes involved in the presentation tier are:
1. Application Download phase
2. Presentation Flow – driven by client side
3. Data Integration – use the service tier, peer-to-peer (allowing two way communication like notifications). XML based using REST or WS-*.
By separating these concerns, each can be optimized for its special needs. Whereas traditional thin-client technology requires the server to be involved in all three concerns, the rich capabilities of RIA no longer require that. In addition, the data integration piece can take advantage of an existing services layer, that is likely already built or under construction within the enterprise. Ganesh also claims that the Front Controller pattern, used in all the server-based web development frameworks, is actually an anti-pattern, made popular simply because of the previous lack of capabilities on the client side. The existence of so many frameworks supports his point, as none of them seem to quite satisfy the needs of the presentation layer. They never will, according to Ganesh, because, among other things, placing portions of the presentation flow logic on the server violates the principle of separation of concerns. Encapsulating presentation flow fully on the client side is now possible with the quickly maturing RIA development environments.
SOUI shares a very similar architecture. Proposed by Nolan Wright and Jeff Haynie (who founded Appcelerator on this principle), SOUI also places presentation flow logic on the client side. The major difference between SOUI and SOFEA is the preference for JSON in SOUI. JSON is more compact than XML. But the advantage of XML is the better typing system (elements and attributes can be strongly typed), along with validation tools built in.
The XAware project appears to be a very viable candidate to fill the gap of the data integration piece within SOFEA and SOUI. The environment is well-positioned to create information-rich services to supply data to the presentation tier. As we continue with project development, we will be adding more support material and features to make it even easier to use XAware for RIA development.
RIA at AJAXWorld 2008
Jeremy Chone of Nexaweb, pointed out the different target markets for UI development, the consumer market (think Google.com, Yahoo.com, MySpace.com), and the corporate market whose users are employees of a company. The consumer market demands the most polished and engaging experience, because users are surfing on their own time, and generally pick the site that’s most enjoyable to visit. The corporate environment, on the other hand, focuses on productivity. Users want to get their job done quickly and efficiently, so they can go home on time after a successful workday. Consumer apps must scale in terms of users. Companies must scale in terms of the number of applications that will help automate business processes. Business agility is important here, where new features and new applications can be built quickly. See http://www.jeremychone.com/ for more information about Jeremy and his blog.
Jeremy Grelle of SpringSource talked about the many Spring projects supporting Rich Internet Applications. Spring hopes to augment the popular AJAX and RIA environments like JQuery, YUI, Dojo, and Ext, but also has projects in the works with competing technologies. Jeremy emphasized that balance must be achieved between client side and server side processing.
The balanced approach that Jeremy talked about seems less pure than another theme I saw in several sessions, that RIA should exploit client processing to the greatest extent possible. In particular, Michael Galpin’s presentation on Networked Application Architecture (his blog at http://fupeg.blogspot.com/) noted the migration of RIA processing responsibilities towards the client. Whereas the 2003 view of RIA was that client and server shared presentation logic responsibilities, the preferred architecture is to place all the presentation logic on the client. This exploits the massive increase in client computing power over the last few years, while reducing server burden. We now get this power for free. Michael canvassed some of the most popular RIA environments, like Flex, Google Web Toolkit, Silverlight, and JavaFX. He currently favors the technology of Flex, with its 97% browser penetration, but he sees good improvements in the competition and vendors try to leapfrog one another. Michael also mentioned a couple acronyms to watch out for as emerging impact makers – SOUI (Service Oriented User Interface) and SOFEA (Service Oriented Front End Architecture). I’m working on separate blog article on these, as both use an architecture near and dear to my heart – using services to supply the information to the client application.
Douglas Crockford, most recently famous as the “discoverer of JSON”, gave an interesting presentation on JavaScript (ECMAScript, officially), its strengths and weaknesses. The primary strengths are support of dynamic objects, the lambda property of functions (a function is an object that can be created on the fly, and passed as a parameter), and the loose typing that eliminates casting in most cases. JavaScript does have its shortcomings, but they are not that plentiful. The real problem, Douglas says, is that JavaScript is so easy on the surface, that developers rarely take the time to really learn it in depth. As a result, he calls JavaScript the world’s most misunderstood language, and highly recommends that developers take the time to learn it, as they will be pleasantly surprised. Douglas created a tool, JSLint, a program checker that he feels helps define a “professional subset” of JavaScript that will help developers avoid the few non-obvious pitfalls of the language. For more information about Douglas and his prodigious contributions to the software world, see http://www.crockford.com/.
I also attended a session on Google APIs focusing on RIA support. Google has been a leader in exposing Google features through an API, encouraging early experimentation in visual mashups and client applications. The Google Web Toolkit (GWT) is Google’s development environment for RIA. It is unique in its approach in that a developer writes code in Java, calling APIs as necessary. Then the client application retrieves components in the form of JavaScript, which is actually compiled on the fly from the original Java. A GWT bootstrap module determines the browser type and version, so that the conversion to JavaScript is optimized for that specific environment.
This is just a sampling of the sessions I attended, but does represent the most interesting of the bunch, at least in my mind.
Monday, September 22, 2008
Service Contract Design Strategies
When designing data services, there are two main strategies for service design: contract-first service design and data source-first service design. Contract-first design is very much a top-down design strategy, while data source-first design is bottom-up. In contract-first service design, the technical interface is clearly defined first, using XML Schema to define the information flowing across the interface. The information objects defined by the XML schema, which are the primary subjects of these services, are often custom-designed, but sometimes they are drawn from industry standard schemas. If you work within an industry with a commonly used industry XML schema, chances are good that schema contains many definitions you can reuse for your own data services.
Data source-first design often fits the mental model of a data-oriented developer or architect who is intimately familiar with the physical data sources. In this scenario, the emphasis is more on exposing the data as is, combining data from multiple sources as necessary. The design process here follows a trail of building low level components, then selecting a set of them, and combining them together into a composite which is then exposed as a service. The final technical interface is a composite of many lower level components. The contract is simply derived as a result of the composition work. Some caution is warranted with this approach, as the resulting interface is essentially hard-wired into the back-end systems, making interfaces brittle in the face of change to data sources or client needs. The benefit to this approach is that it leads to extremely quick service implementations, and fits the mental model of many of those charged with implementing data services. Areas of development where many fine-grained services are required will benefit from these approaches.
Monday, June 30, 2008
Categories of Services
In previous blogs, I have discussed contract-first service design and the benefits to constructing services as information-rich, smart endpoints. In his most recent book, SOA: Principles of Service Design, Thomas Erl formalizes and extends these ideas by defining 3 categories of services based on the type of logic they encapsulate, the extent of potential reuse, and the degree of focus on a singular domain. The service categories are:
Entity Services – modeled around business entities like customer, purchase order, insurance policy, and invoice. Such a service typically includes the CRUD-like operations to Create, Read, Update, and Delete instances of the business entity. As I’ve mentioned in the past, entity services are ideal candidates for contract-first service design, with entities modeled in XML Schema, and that schema becoming the basis of the interface to create, read, update, or delete a business entity.
Task Services – services that generally model a business process in the enterprise. This type of service very often combines business logic and calls to other services, and because of its focus on a particular business domain, often has a low degree of reusability. Orchestration and choreography environments, along with environments that facilitate flow logic (XAware, for example) are common ways in which to create task services, although many are still writing code to stitch together services with business logic to expose “task” services. Task services also typically involve operations on more than one entity. When processing a purchase order, for example, a process may require validating a customer (using the “customer” entity service), generation of a unique purchase order number (using a order number generator service – a utility service), and adding the order to the provisioning system (using the purchase order entity service). A requirement to access multiple entities is an indicator that your service is a task service. Task services are often referred to by other names, among them: business process services, process services, task-centric business services, or orchestration services (when using orchestration tools).
Utility Services – services that are technology-oriented rather than business focused. Utility services typically provide common and reusable functions that cut across functional domains, such as event logging, notification, and unique number generation. Utility services are often referred to as “technology services” or “infrastructure services”.
The service category definitions are just the beginning in Erl’s book. The heart of the book discusses a palette of principles that guide a designer through the complex activity of creating services with appropriate characteristics for a particular use case and environment within an SOA. This is a book that I highly recommend, and I plan on referencing Erl’s ideas frequently in future blogs.
Wednesday, April 2, 2008
The Long Tail of Services
The “Long Tail” moniker has been used (some would say overused) in marketing and mass media over the last couple years. Now, as different use cases for SOA evolve, the metaphor seems appropriate to explain the growing use of services outside of the core domain of SOA, business process implementation and integration. If you’re not familiar with the term “long tail”, it is used to describe how companies like Amazon, iTunes, and Netflix have monetized the huge number of low-volume products they carry in inventory. While traditional retailers make most of their money selling only the blockbusters, these companies have discovered how to make significant money from the products that sell in very small quantities. In “The Long Tail” diagram below, the green area (the head) represents the “blockbusters”, a small number of high volumes sales items. The yellow area is the tail, representing a large number of items selling at very low volume. The shaded area under the curve can be thought of as revenue. You can imagine that if the tail is long enough, its revenue is significant, and can even exceed that of the head. Chris Anderson coined the term “The Long Tail”, and wrote an excellent book on the subject, which you can read more about here.
The Long Tail of Services
The long tale metaphor also aptly explains and helps justify the phenomenon of minimalist services created for singular purposes. While the SOA mantra is to create services for reuse, the rise of Web 2.0 technologies like
The Long Tail of Services: Single-use and low reuse services may outnumber those designed for reuse. In “The Long Tail of Services” diagram, the horizontal axis represents individual services, and the vertical axis shows “instances of use”. The head area represents services that are reused many times. The tail area shows services with ever decreasing reuse, culminating with services used only a single time (single-use services).
Services for Web 2.0 Applications
Building services for consumption in a user-facing application is quite different than building services to feed core business processes. If you download and use any of the AJAX-like environments, or Adobe’s Flex, and build a sample display fed from XML data, you’ll likely notice the XML structure tends to follow a simple, almost table-like structure. This is very simplistic compared to the information-rich XML structure you might expect in real-world business objects like a purchase order, invoice, or insurance policy. The latter are the domain of SOA proper, the subjects manipulated by services while moving through business processes.
At first glance, I would say the Web 2.0 style services are high-quantity, commoditized, point services fulfilling a specific, singular purpose. Don’t expect reuse from these, as they were not designed with reuse as a design criteria. But thinking further about this, I now feel that a small service like this may actually be a good candidate for reuse. The reason: its visualization is the main manifestation of its existence. In fact, a user who sees the visualization of the information is probably going to be the one to recognize that it can be used in other situations. Isn’t this a much more powerful reuse driver than a UDDI query, or worse, a WSDL file sitting on a web server or file system somewhere? Even with a nice WSDL viewer, it takes imagination to envision the data reused in another application. If this visualization aspect does turn out to be a big factor in reuse, perhaps that will drive a movement to publish services with default visualization components. It sure makes sense to be able to visualize a data structure in a display composition, rather than simply viewing an XML structure.
Other Aspects of The Long Tail of Services
The Long Tail of Services diagram is also a good context to help rationalize other aspects of service oriented design. I can envision where on the graph you would expect to apply the most governance energy (services whose intent is high reuse), and where you might expect to use light-weight REST or POX rather than SOAP as a delivery mechanism (in the long tail). Debates such as REST versus WS-* are still simmering, but The Long Tail of Services may at least provide a different dimension on the discussion, providing a context where one point of view makes more sense relative to one section of the curve.
Credits: The Long Tail picture was created by by Hay Kranen / PD, and annotated by me.
Monday, March 31, 2008
Web 2.0 Powered by SOA
Mark Scrimshire blogged about attending a Ray Valdes presentation on Portals and Mashups (see the blog here). The article nicely explains how Web 2.0 and SOA technologies combine to produce a new generation of portals, fed by information culled from throughout the enterprise. The separation of concerns between Web 2.0 and SOA technologies can be summarized in a single sentence:
“Information is delivered through a Portal, Not by a Portal.”
Simply put, Web 2.0 provides the visual set of user-customizable portlets, while SOA supplies the information for the visual screens. The information is typically provided in a service-oriented manner, with a lightweight REST approach gaining preference over SOAP for the service delivery mechanism. Interestingly, over 50% of the audience was specifically using an SOA strategy, but only about 10% felt the process was successful. Deployment cylces were reportedly very long, on the order of 2 years before demonstrating value.
The project I lead at XAware.org fits nicely into this Web 2.0 and SOA approach. XAware lets you quickly build and manage data services from any number of enterprise data sources, then deliver those services using a lightweight REST or POX (plain old XML over HTTP) transport.