Discussions

News: Designing Rule-Based MDBs using Encapsulated Business Rules

  1. In this article, Cristina Belderrain describes the Encapsulated Business Rules pattern and shows how rule-based components can be implemented as message-driven beans to provide flexible, sophisticated business services. The sample source code applies encapsulated business rules to a real world application and shows how to turn a distributed component such as an EJB into a rule-based component.

    Read Message-Driven Beans and Encapsulated Business Rules

    Threaded Messages (29)

  2. Here are a few links[ Go to top ]

    http://www.pst.com/opsj.htm
    http://drools.org/index.html
    http://herzberg.ca.sandia.gov/jess/
    http://www.ilog.com/

    Try those rule solutions before rolling your own.

    And, if you're going to create your own rule evaluation engine, at least make it JSR-94 compliant.

    http://www.jcp.org/en/jsr/detail?id=94

    Cheers!
  3. And another[ Go to top ]

    You could also try IDIOM http://www.idiomsoftware.com

    It's service based rules engine that be accessed directly, via JMS, EJB, SOAP etc.
  4. Here are a few links[ Go to top ]

    Here we go again!

    Here's are a ton of open source rule engines written in Java.

    11 of them as of last count. Haven't add con:cern yet since I can't figure out yet what its about. Also, I'm not going to add this article 'coz its another case of reinventing the wheel.

    Enjoy!
  5. Blackboard pattern revisited[ Go to top ]

    This is also another play of the already-documented Blackboard pattern from POSA, volume 1. However, it does explain an implementation better than POSA does.
  6. Drools with J2EE[ Go to top ]

    Has anyone tried to implement Drools within J2EE with EB and MDB? If yes, please tell your experience...

    Thanks,
    Lofi.
    http://www.openuss.org
  7. Experience with drools[ Go to top ]

    A perfect BRE must offer:
    a) a debbuger;
    b) an editor;
    c) an auditing tool, integrated with a workflow;

    Without a debbuger drools can be use only to teach the concpet.
  8. Drools and J2EE Article[ Go to top ]

    Good article on Drools and J2EE on onjava.com at:

    http://www.onjava.com/pub/a/onjava/2005/08/24/drools.html

    Paul
    FirstPartners.net
  9. See also...[ Go to top ]

    One more product to consider before building a rules engine:

    http://www.resolutionebs.com/products.html

    The big differences with Centrifuge: (1) business analysts can enter and maintain rules -- not just coders; (2) Centrifuge supports batch-like rule execution, but it can also power a very interactive UI.
  10. I actually found the posting of an well written and informative design pattern with no mention of 'vendor this or open source that' a refreshing change from some of the recent postings - thank you!

    cheers,

    Rob
  11. I agree, great article.

    LB
  12. Got to disagree[ Go to top ]

    Got to disagree with you. While the article described a useful design pattern, it's about 10 years out of date. No one should write code that performs the evaluation cycle of a ruleset except as an academic exercize.

    It's been done, several times before, and by programmers better than 99% of the coders out there. If any programmer that worked for me insisted on rolling his own rule evaluation framework instead of using an existing one I'd fire him in a heartbeat.
  13. performance problems[ Go to top ]

    No one should write code that performs the evaluation cycle of a ruleset except as an academic exercize.


    Totally agree with Greg. Performance is the main problem with predictive rules. When the number of rules is less then hundred (academic example), the evaluation cycle could be acceptable. But in real world the number of rules could exceed thousands, and dozens thousand, and such cycle is not acceptable.
    It will be necessary to use some special algorithms from neural networks domain.

    Alexander
  14. performance problems[ Go to top ]

    But in real world the number of rules could exceed thousands, and dozens thousand, and such cycle is not acceptable.

    Forget the cycle for a moment, the pattern requires that each rule is its own running thread. Since each rule can only have a boolean outcome, you can easily get into several thousand rules building a moderately complex system.

    I don't believe this solution will scale for larger problems, and the structure is probably overkill for smaller problems.
  15. performance problems[ Go to top ]

    Sorry, meant to say each Evaluator is its own running thread.
  16. you comments don't advance anything[ Go to top ]

    I disagree with you. Userstanding patterns here is key. Yes, we want to use existing projects and not re-invent the wheel, but it is useful to know the patterns behind these projects. I personnaly would not want anyone working for me who did not undertsand how a rules engine worked.

    Also, talking about firing people is not helpful to this site. Isn't it enough to say that you disagree and why. The site is about learning and knowledge sharing, not about corporate politics.

    Bruce
  17. Must agree...[ Go to top ]

    Is Barton a Wanker or a SUPER GENIUS?
  18. re: Got to disagree[ Go to top ]

    Greg, in regards to both the usefulness of this article and your management pratices, your comment is utter rubbish. The article was titled "How to design a rule-based MDB." As such, it was very insightful and helpful in understanding the basic mechanics of a rules engine. It is not necessary, nor desired, for the article to make references to actual products. Please keep in mind that this site exists for academic purposes, as well as practical application-and-use reviews. If we wanted a product review for a rules engine, we could pick up JDJ. I, for one, am very appreciative of Ms. Belderrain's efforts.

    Excellent work, Christina!
  19. Got to disagree[ Go to top ]

    Yeah, Greg's an idiot.
  20. Tosser[ Go to top ]

    Greg Barton,

    What a complete wanker.
  21. Tosser[ Go to top ]

    The article is great. Personally, no fear about building business solutions using this pattern.

    <Greg Barton>
    "If any programmer that worked for me insisted on rolling his own rule evaluation framework instead of using an existing one I'd fire him in a heartbeat."
    </Greg Barton>

    Just curious : what would you do if your programmer/architect show you http://www.caucho.com/hessian/ as an alternative to Web Services for a small or even medium project ?

    <Kambiz Shahri>
    "What a complete wanker"
    </Kambiz Shahri>

    Wanker (definition from http://www.urbandictionary.com) :
    "Derogitory term used to infuriate Americans as they don't know what it means."

    Rodolfo
  22. con:cern tries to apply the rule based processing idiom to the workflow world. Sorry, the homepage is in german, only. But will be translated, soon! Also the graphical modeller is not online yet.

    Holger Engels
  23. Rule Engine Products[ Go to top ]

    While I understand the pattern, I fail to see why anyone in 2003 would code rules this way. Why not use a commercial rules engine such as Blaze Advisor? Check out http://www.fairisaac.com/Fairisaac/Solutions/Enterprise+Decision+Tools/Blaze+Advisor+Tech.htm
  24. Rule Engine Products[ Go to top ]

    Mark Eastwood wrote:

    > While I understand the pattern, I fail to see why anyone in 2003
    > would code rules this way. Why not use a commercial rules engine
    > such as Blaze Advisor? [snip]

    Hi Mark,

    thanks for your message. First, let me notice that my article clearly states why you should (and should not :-)) use a commercial rule engine. Please see the "Forces" section.

    Now, in case you haven't had an opportunity to actually use Blaze Advisor, I think you might want to take a look at a small Advisor rule set I wrote a couple years ago. If you would like to get it, just let me know so I can send you a copy as a TXT email attachment (11 KB). If you're looking for a quick way to assess the differences between a commercial rule engine and the approach described in my article, this would probably help.

    Regards,

    Cris
  25. Now, in case you haven't had an opportunity to actually use Blaze Advisor, I think you might want to take a look at a small Advisor rule set I wrote a couple years ago. If you would like to get it, just let me know so I can send you a copy as a TXT email attachment (11 KB). If you're looking for a quick way to assess the differences between a commercial rule engine and the approach described in my article, this would probably help.
    Hi Cristina,

    I'd like to receive a copy of your work about Advisor rules.
    my mail: ggallego(at)bol(dot)com(dot)br

    Thanks,

    Glauber
  26. Great for simulators[ Go to top ]

    I was looking for a way to efficiently simulate systems that communicate via
    JMS with our system running on a J2EE server, when I stumbled on this article.

    The pattern applies very nicely to this kind of problem.
    Thanks!
  27. I was glad that I waited a few days to post my response to this article. First, let me say to Cris that this is a great article. Second, I think it is very sad that some people are smashing the creativity of their programmers. It is not a good idea to let your developers always be code cowboys, but this IS how we got a lot of the tools we use today. Many frameworks have been opensourced from companies that developed something inhouse that ended up working very well for more generalized situations. A perfect example of this are tools like log4j. It is still maintained and developed by basically one person, Ceki Gülcü.

    By not allowing people to use there creative abilities software development would slow down to a crawl. Why use something like Java when you can do anything in C that you can in Java? I don't agree with that philosophy, but it is of the same mentality of telling your programmers to not think because we already have a language that we can do anything we need to with.

    Great article Cris, I am currently looking at integrating something like this into a large application. Instead of just speculating what will and won't happen, I will be prototyping some code and run load tests against it. We so often get wrapped up in what happens when we have 4 million users on our system that we don't bother to worry about getting 4 people on out system.

    Thanks again.
  28. serious agree[ Go to top ]

    The idea is of the most important. Though we have some full-fledged solution, we need new idea.

    Great article.
    Thanks.
  29. did any one test drive the article?[ Go to top ]

    I think no one really took an oppurtunity to use the article in real live scenario. I did , and found 2 major problems
    1. The most touted one here, "performance"
    2. It simply fails when i tried it to embed it in well designed OO application
  30. Hello,

    I'm glad to know you've tested the code. Still, would you mind to explain exactly how it failed?

    Thank you,

    Cristina