How to Fail With Drools or Any Other Tool/Framework/Library
Join the DZone community and get the full member experience.Join For Free
what i like most at conferences are reports of someone’s failure to do or implement something for they’re the best sources of learning. and how to fail with drools (in norwegian) by c. dannevig of know it at javazone 2011 is one of them. i’d like to summarize what they learned and extend it for introduction of a tool, framework, or library in general based on my own painful experiences.
they decided to switch to the drools rule management system (a.k.a. jboss rules) v.4 from their homegrown rules implementation to centralize all the rules code at one place, to get something simpler and easier to understand, and to improve the time to market by not requiring a redeploy when a rule is added. however drools turned out to be more of a burden than help for the following reasons:
- too little time and resources were provided for learning drools, which has a rather steep learning curve due to being based on declarative programming and rules matching ( some background ), which is quite alien to the normal imperative/oo programmers.
- drools’ poor support for development and operations – ide only for eclipse, difficult debugging, no stacktrace upon failure
- their domain model was not well aligned with drools and required lot of effort to make it usable by the rules
- the users were used to and satisfied with the current system and wanted to keep the parts facing them such as the rules management ui instead of drools’ own ui thus decreasing the value of the software (while increasing the overall complexity, we could add)
at the end they’ve removed drools and refactored their code to get all rules to one place, using only plain old java – which works pretty well for them.
lessons learned from introducing tools, frameworks, and libraries
while the know it team encountered some issues specific to drools, their experience has a lot in common with many other cases when a tool, a framework, or a library are introduced to solve some tasks and problems but turn out to be more of a problem themselves. what can we learn from these failures to deliver the expected benefits for the expected cost? (actually such initiatives will be often labeled as a success even though the benefits are smaller and cost (often considerably) larger than planned.)
always think twice – or three or four times – before introducing a [heavyweight] tool or framework. especially if it requires a new and radically different way of thinking or working. couldn’t you solve it in a simpler way with plain old java/groovy/whateveryougot? using an out of the box solution sounds very *easy* – especially at sales meetings – but it is in fact usually pretty *complex*. and as rich hickey recently so well explained in his talk , we should strive to minimize complexity instead of prioritizing the relative and misleading easiness (in the sense of “easy to approach, to understand, to use”). i’m certain that many of us have experienced how an “i’ll do it all for you, be happy and relax” tool turns into a major obstacle and source of pain – at least i have experienced that with websphere esb 6.0. (it required heavy tooling that only few mastered, was in reality version 1.0 and a lot of the promised functionality had to be implemented manually anyway etc.)
we should never forget that introducing a new library, framework or tool has its cost, which we usually tend to underestimate. the cost has multiple dimensions:
- complexity – complexity is the single worst thing in it projects, are you sure that increasing it will pay off? complexity of infrastructure, of internal structure, … .
- competence – learning curve (which proved to be pretty high for drools), how many people know it and availability of experts that can help in the case of troubles
- development – does the tool somehow hinder development, testing or debugging, f.ex. by making it slower, more difficult, or by requiring special tooling (especially if it isn’t available)? (think of j2ee x spring)
- operations – what’s the impact on observability of the application in production (high for drools if it doesn’t provide stack traces for failures), on troubleshooting, performance, deployment process, …?
- defects and limitations – every tool has them, even though seemingly mature (they had already version 4 of drools); you usually run into limitations quite late, it’s difficult if not impossible to discover them up front – and it’s hard to estimate how flexible the authors have made it (it’s especially bad if the solution is closed-source)
- longevity – will the tool be around in 1, 5, 10 years? what about backwards compatibility, support for migration to higher versions? (the company i worked for decided to stop support for websphere esb in its infrastructure after one year and we had to migrate away from it – what wasted resources!)
- dependencies – what dependencies does it have, don’t they conflict with something else in the application or its environment? how it will be in 10 years?
and i’m sure i missed some dimensions. so be aware that the actual cost of using something is likely few times higher than your initial estimate.
another lesson is that support for development is a key characteristics of any tool, framework, library. any slowdown which it introduces must be multiplied at least by a 10 6 because all those slowdowns spread over the team and lifetime of the project will add up a lot. i experienced that too many times – a framework that required redeploy after every other changes, an application which required us to manually go through a wizard to the page we wanted to test, slow execution of tests by an ide.
the last thing to bear in mind is that you should be aware whether a tool and the design behind it is well aligned with your business domain and processes (including the development process itself). if there are mismatches, you will need to pay for them – just think about oop versus rdbms (don’t you know somebody who starts to shudder upon hearing “orm”?).
be aware that everything has its cost and make sure to account for it and beware our tendency to be overly optimistic when estimating both benefits and cost (perhaps hire a seasoned pessimist or appoint a devil’s advocate). always consider first using the tools you already have, however boring that might sound. i don’t mean that we should never introduce new stuff – just want to make you more cautious about it. i’ve recently followed a few discussions on how “enterprise” applications get unnecessarily and to their own harm bloated with libraries and frameworks (e.g. java isn’t fun anymore + comments , @jhannes on soa ) and i agree with them that we should be more careful and try to keep things simple. the tool cost dimensions above may hopefully help you to expose the less obvious constituents of the cost of new tools.
ps: i hope the ibm architect who once denied me to use xstream thus forcing me to parse a (simple) xml via the basic apis is amused by this post. i was too young and unexperienced then. (not implying i’m not that anymore .)
Opinions expressed by DZone contributors are their own.