March 16th, 2009 Comments Off
Anne Thomas Manes wrote a farewall for SOA in her blog post SOA is Dead, Long Live Services. InfoQ asked for comment from SOA thought leaders and architects on this matter which created quite a stir and the usual amount of noise as well. One of the most interesting responses I read was from Stefan Tilkov in his blog post Defending SOA. Now I cannot resist, but give my perspective.
SOA is an attempt to create an architectural style that embodies the heart of the business – the domain. In any business the domain is vast and so there are many subdomains or even very distinct domains. In my workshop on Bootstrapping Your SOA Project, I defined a service very traditionally as providers and consumers connected by some execution context that hides implementation. Now, I like to abstract it a bit more and think of services as business intentions. These intentions cut right through the fat and get very close to the bone which is all about the domain. That’s why I think DDD is at the heart of SOA.
Is SOA dead? Not yet but the vendors are doing a great job of killing it with implementations.
Should SOA die? No. it’s an architectural style worth cherishing since it deals with legacy and new software at the same time, hence spanning multiple systems (like Stefan Tilkov nicely explains).
Does SOA need an ESB? Not necessarily. I think the ESB is just a pattern that happens to have an implementation called the ESB (vocabulary that sucks!). I have seen some some really complex solutions with an ESB that would have worked just fine with, for example, a simple RMI call instead.
Is it about Business Process Management? Partially. When you span multiple systems then you will likely do so with processes. But it’s all about managing state across multiple systems and what nicer way is there than transferring state, i.e. being RESTful (and I am not talking about REST over HTTP). This also suggests that you should think asynchronously as well.
Is SOA heavyweight? No. But the vendors make it very, very heavyweight because that is the core of their economic model. I like to think about all the little Unix command line tools that you can string together to solve a particular problem, like the FindAndDeleteAllOldLogs capability that is part of the FileManagementService
What is killing SOA? The lack of readiness for existing systems that comes from existing software development thinking in most teams. SOA demands that you think about state, scalability, ownership, backward compatibility, testability … things that go towards creating decent API’s for your systems. And the more vendor swagger we have, the less development teams think about API’s.
Is SOA Dead? Yes. It was still born. But it will be reincarnated as SOA when vendors focus on tools to help people discover domains and increase automation, and not creating heavyweight obstructions; and when developers figure out that domain understanding is vital and writing good API’s still count – more than ever before.
March 13th, 2009 §
The last two geeky conversations I had, stumbled upon the same thing – how do you measure the effectiveness of requirements in describing the business to the business and describing the specification to the developer?
So, I posed the question “How far away are you from executing your requirements?”. If you are going to go through various steps and stages to get to compilation and then execution, then every step is an opportunity for valuable information being lost in translation. If you can compile your requirements immediately then nothing will be lost.
Each additional step between requirements description and compilation and execution is an opportunity to confuse the user and the developer and everyone in between. That’s why fully dressed use cases are not so effective as fully dressed behavior driven stories. And that’s why BDD is very agile and a great asset in DDD and use cases just don’t cut it anymore.
Right now, my favorite tool is Cucumber. I can execute the requirements and that raises the clarity ranking of my requirements super high.
March 13th, 2009 §
I was talking SOA – again! I was arguing that modeling of services in UML, BPEL, and any other fancy acronym immediately constrains you to a specific implementation. For example, UML means that your are thinking OO already, BPEL means that your are thinking business processes already. But are those (and others) the best ways to model or represent a service?
In SOA, I have a suspicion (as yet untested!) that a service is closer to an intention than anything else that I can think of because it describes the latent value of the business that invariably is lost by SOA implementations and product stacks. Now that leaves us with a problem – how do you describe intentions consistently across any domain? I don’t know how to do this because to describe intentions in a domain, you need to understand the vocabulary of the domain. Until we can represent vocabularies then only can we create a metamodel for these business intentions.
So how do we model intentions in a single domain since I cannot use UML (implementation!), XPDL (implementation!), BPEL (implementation!) etc? Since the domain is constrained by its vocabulary, we need to create a language that uses this vocabulary. And that, my dear folks, is nothing but a DSL. If we, therefore, model intentions (the services) with a DSL, then we are in a position to translate or transform that intention into any implementation that we like. Realistically, we will likely need additional metadata surrounding the intention described in the DSL to satisfy UML, XPDL, BPEL, WSDL, RESTful APIs, etc.
When we think of the business as what they intend to do or achieve, then we are actually working at a higher level of abstraction – at a meta-level. That is hard to do, but if you do it reasonably well, then you have more freedom when it comes to implementation.
SOA is so screwed up at the moment and most are climbing into or out of rabbit holes because the business intentions are being ignored or forgotten far too early or thought about far too late. Perhaps the most effective SOA implementations will be realised with a suite of DSL’s and the only toolset that you really need is a language workbench and some very skilled language oriented programmers.
March 2nd, 2009 Comments Off
I had quick DSL appropriateness argument last week for someone that was objecting about us implementing a DSL for some small part of the domain.
The argument: “Business users will never write code”.
My response: “But business users will read code”.
And to test the argument, I later emailed one of the business users with a small snippet of the DSL that we were crafting and simply said in the email: “Please check the following configurations for the client…”.
His response: “You incorrectly configured the final_costing_policy. It should be …”
In the large, the DSLs that you create are going to be read by a larger audience than just developers. So, like all good code, this DSL code should be highly readable, but not all of your audience needs to know it’s syntax in detail. You create a DSL to make your life, the developer, easier. Getting business users to understand what you are doing is part of making your life easier. Anyway, is it not about ubiquitous language and vocabulary? You can’t get closer to the domain than revealing data and behavior with a DSL, can you!?
March 2nd, 2009 Comments Off
I’ve been doing some internal DSL coaching recently, and my coaching-partner and I have been working BDD/TDD style. It turned out to be quite a nice experience overall. We started with a Cucumber based feature that described the behavior of a typical DSL script and we drove it down into rpsec where we tested each little part of the script. In the end, I achieved what I set out: the person I was coaching grokked the whole “code is data” idea behind DSLs.
Then I started thinking about what it takes to coach external DSLs. I got really scared – parsers, generators, abstract syntax trees. Those were things that most people wanted to forget about the day after they wrote the exam for that horrible semester course in university. What makes it worse is that I never did that in university – I did Electronic Engineering and we spent our coding time figuring out how to do Fast Fourier Transforms on digital signals.
But when I look at the progress that is being made in language workbenches to help us create DSLs, then I reckon we should dust off those books and start paying attention again. Some of these language workbenches still leverage a host language such as Java or C#, but the act of using a structural editor that edits the AST directly is strangely weird. But, some refactorings are just not a problem anymore. For example, if you are changing the node on a tree, then all the references to that node are automatically aware of it. Compare that to a text editor where you need refactoring wizardry in the tools to make sure all references are updated neatly.
I think that language workbenches may be a great tool for coaching DSLs because the things that made your head spin during that lex and yacc week, are made a whole lot simpler. You can focus on designing the language and walk into ASTs with less fear. But, be warned — language design is not easy, and you still need to know about ASTs and parsers and generators. In fact, just write a parser and a generator and it will be a learning experience that goes beyond DSLs. Better still, do it BDD/TDD style.
The relevancy of language oriented programming is just going to continually increase. Those previously “irrelevant” courses are important again. Watch out, the gap just got wider.