Idiots guide to Service Orientated Architecture (SOA)

Lost in the hype around Service Orientated Architecture (SOA) is the fact that the idea is really really simple. It’s all based on the idea that most applications (and that includes websites) are built either to be used by people , or used by computers. The pictures below (a free preview from the Enterprise Java Briefing) show what I mean.

In a ‘normal’ application, such as a online banking website, we need to remember what the user did last (are they logged in, what account are they looking at, are they in the middle of making a payment). If we didn’t , the user would get annoyed about having to repeat themselves every step of the way. It would also make for pretty complicated screens, to allow the user to enter all the information in one go. Instead , we allow the user to enter information in several steps, and remember where there are each time.

Soa Client

In an application designed to be used by computers, we don’t have to worry about this. We can force the computer to give us all the information required all in one go – username , password, bank account to take money from , bank account to give money to, date to execute transaction. For a computer , this is actually easier ; we make one call to our banking service and we are told it has succeeded or failed. It’s also easier for us to build our service:

  • Each service (transfer money, book flight , execute share trade) only does one thing.
  • Because each service ‘forgets’ after each call, we don’t need to worry about trying to remember what we were doing before.
  • Because we have no memory, services are very scalable; we can make several copies of the same service and put them in a pool. Any client can talk to any service – no waiting for a particular server to become available.

Soa Service

So that’s Service Orientated Architecture (SOA) : programs that do one thing (a bit like a function call to a method) exposed that other computers can call. So what’s the big deal? Like all good ideas , a simple concept goes a long way.

Take a look at the picture below. It’s like a Visio diagram, but in fact it’s drawn by the Eclipse Based JBoss IDE. It shows a workflow for an online commerce store – pretty easy to understand. This example uses JBoss Java Business Process Managment (jBPM), but companies such  Tibco, Cape clear and Oracle BPEL have similar products.

soa workflow

Here’s the clever bit; each of these steps is executed by one of the services that we talked about earlier. This means that if the business process changes (and it will), then all you have to do is re-arrange the diagram ; little or no coding changes should be required.

This abilility to mix , match, combine and remix services leads us to a lot of other good things (and we’re only scratching the surface here).

  • Because our services don’t have to run on the same machine, we can use SOA to create a distributed application. This is the concept behind the BPEL (Business PRocess Engineering Language)
  • Services tie well to Ajax and Web 2: Our Ajax web page or portlet can call as many services as it requires to get the job done (it’s one of the reasons Tibcom is sponsoring the open source DWR project)
  • We can call many services at once. If these this service calls are xml based ,or we send these calls as a message then we can filter, duplicate, pass and other distribute these calls as we set. These are the ideas behind Apache Synapse, Apache Servicemix and the  Enterprise Service bus (ESB) in general.

What do you think? Is SOA useful , or over hyped?

related posts

Advertisements

Java and those pesky Google APIs

Recently one or two people disagreed with what I had to say about the impact that the Google, Amazon (and other) API’s will have on Java. Considering the ratio of positive to negative comments (about 3 for and 30 violently against), I obviously need to express myself in a clearer way. The link to the original post is at the end of this article, read on before you consider flaming me.

Amazon Web Services Logo

So , deep breath , here goes.

Compare the the way you develop now , with the way you built software 10 years ago. Do you remember having to manage your own memory? Or the pain of trying to deploy your software on different machines without a JVM? Or the hassle of trying to write distributed software using Corba? Or using a text editor instead of the fine IDE’s (Eclipse, Netbeans or JDeveloper – take your choice) that we have today? Would you consider building your software without a tool like Ant or Maven?

(Shudder). Things have moved on ,and I am very glad they have. Likewise, the way we develop 10 years into the future will be very different. I don’t know what the future will look like, but here’s a simple guess.

The biggest trend today is the move from software running on your computer , to software being delivered over the web. I’m not talking about the buzzwords being thrown about regarding ‘Service Orientated Architecture’ or ‘Enterprise Service Bus’. I’m talking about simple API’s that are available for use over the web today. Like the API’s and products from Google – including their Documents and Spreadsheets, and their Authentication service.

‘Everything should be made as simple as possible, but not one bit simpler’ – Albert Einstein

‘You Ain’t Gonna Need it’ – Anon, XP Mantra

As a good Agile Developer you’d probably agree with these quotes. But what if the most simple way of doing things was not to develop in Java at all? Most people don’t build their own operating system – they use Linux, Windows or OS X instead. Most people don’t write their own Java Server – they use Tomcat, JBoss or your server of choice. The pattern is the same. A small, dedicated core of developers builds the product, and the rest of us say ‘thank you very much’ and use it to get things done.

This range of ‘off the shelf’ solutions is increasing all the time , even before the online services arrived on the scene. As a Java developer , you’ve said ‘thank you’ , downloaded the latest version and integrated it into your solution. The time you save means you deliver other cool features instead. Java is very good at this ‘download and integrate’ process – not only is it a key benefit of Object Orientated Software, but Java has the widest range of solutions available (if you don’t believe me , just check out Sourceforge).

Java can also let us build our solutions (either partly or fully) around the online API’s. Java has great networking and XML handling ability already. In time this will become as normal as the idea of using a JVM. Great – we use these API’s pretty much like we do libraries today, and we can continue developing pretty much as before, right?

Wrong.

Remember, what is the most simple way of doing things? What if the most simple way of doing things was not to use Java but to use a more simple language (like Ruby or PHP) instead? Until now there were a couple of advantages that Java had over these ‘simple’ (and that’s a compliment) languages. When using online API’s these advantages disappear, or worse, become a liability.

  • Scalability and Robustness. Enterprise Java is massively scalable (it’s one of the reasons for it’s complexity). But can even you outscale Google?
  • Security. Enterprises haven’t (yet) learned to trust the security of online applications. This trust will be hard earned over time. But already you can make the argument that you data is safer with Google / Amazon / other service provider than on your average virus-ridden home PC.
  • Language Ties. To use the Java libraries you needed a JVM somewhere in your solution. Once you had a JVM , you might as well write your own solution in Java. But when the product you are extending is hosted elsewhere, you are free to code in the (most simple) language of your choice.
  • Always on. As long as you have a connection to the web, your programs can use the API’s. Scripting languages like Ruby and Python can claim to be even more portable. Not only can they run natively in most environments, they can also be deployed via a JVM if that is your choice (under the guise of JRuby and Jython)
  • Features. Need a feature that you don’t have in your scripting language? Just borrow it from Java by running in the JVM. How can Java win a ‘features arms race’ against that?

So do we face a form of developer apartheid, where a ‘hard core’ of Java Experts develop web API’s that the rest of us use via scripts? Let me know what you think. Like the original blogpost said, it may not be the end of Java, but perhaps the end of Java as we know it.

Enterprise Java Presentation at DCU

On Wednesday, I’m presenting on the topic of Enterprise Java at DCU (Dublin City University) , in conjunction with Trigraph.

Trigraph Logo


I’ll blog later about bits and pieces of the slides (for commercial reasons I can’t publish the full set here), but the overview is below.

Description: Success or failure in your business depends on dealing with information faster and better than your competitors. This briefing shows you how Enterprise Java tools can do this and how to apply them to your organisation. Crucially, the briefing shows you when not to use Enterprise Java and details the alternative approaches.The briefing will give delegates an overview of the Java Web development environment, how to architect and distribute multi-tier applications and how to link these components with existing sources of information using Enterprise Application Integration (EAI). Most business have substantial investments in existing and legacy IT systems and the briefing will show how to integrate these with techniques such as JMS Messaging/ MQ Series, SOAP / XML or using the Java Connector Architecture (JCA).

As well as examining the main Java Application Server vendors (including Sun , IBM , Oracle , BEA and JBoss) the briefing will detail the technology stack that they offer. This stack includes Web presentation frameworks and SOA – Service Orientated Architecture at the Front end. In the middle (Business) layer this covers the capture of Business knowledge using Business Rule Engines and workflow (BPEL). At the back (Service) layer, this includes database integration using JDBC, and the Enterprise Service Bus (ESB).

What Problem are we trying to solve?Where Java Fits in Enterprise Computing.
Enterprise Application Integration (EAI).
A Componentised & Connected Enterprise.
Enterprise Java Architecture Overview.
Enterprise Java Platform Roles.
Benefits to the Enterprise.
Alternatives (.Net , PHP , Oracle , Lightweight Java Frameworks , scripting)
Scripting Languages and Enterprise Java (Ruby, Python, Groovy)
Vendors (IBM, Oracle, Sun , Bea , JBoss and SAP)
Vendor Specific Solutions (e.g. Oracle Fusion / ADF , IBM MQ )
Market Trends – Resource availability (can we get the people to do this?)

Foundation Technologies & Techniques.

Enterprise Web 2.0 and Service Orientated Aritecture (SOA).
Integrating with other Systems ( Legacy Systems, Oracle etc)
Enterprise Java Beans 3
Middleware (MOM, Rule Engines, Workflow)
Java on the (Enterprise) Desktop
Web Services / Enterprise Service Bus
Best practices (Code standards, Build standards, Version Control / Iterative Development / Junit)
UI Layer: HTML, Servlets, JSP, XML/XSLT.
XML’s Role in the Enterprise.
Application Tier: EJB, JNDI, JDBC, JDO.
Integration Technologies.
Java Connector Architecture- JCA
RMI, CORBA/IIOP, SOAP.
Security – Application and Server Level
Java Access & Authorization Service (JAAS).
Object-Orientation & UML.
Design Patterns.
Frameworks (Struts , JSF, ADF, DWR, Spring, Hibernate)
.Net interoperability

Enterprise Java Application Architectures.

Overview of Enterprise Application Servers.
Commercial Application Servers.
Distributed Application Models with Enterprise Java.
Enterprise Java Application Server Basics.
How to Choose a Enterprise Java Application Server.
Enterprise Java Application Architecture.
Building a Enterprise Java Application.
Deploying the Application.

Enterprise Java & Your Business.

Planning for Migration.
First Steps.
The Implementation Plan.
Organisational Challenges.
What’s next for Enterprise Java?

Close.