Jess in Action
Eric Kaun's review, continued Jess in Action starts with an introduction to rule-based systems, goes through the basics of the Jess language, and then dives into the examples; the appendices include API references to both Jess functions and Jess's Java APIs, and numerous links and references are scattered throughout the book. If I have any complaint about the organization, it's that the book could have been even more example-driven, abandoning (or shortening) the chapter on syntax and basic functions and introducing them only when used in an example; the rest could have been left to the appendix of Jess functions.
The book is interesting and readable, but dense with concepts, so it contains only 388 pages of actual text, and 50 pages of appendices will take some (well-spent) time to get through. A second skimming impressed me anew with the richness of the material, and the productive way in which it's presented, so I recommend reading the book once to get the overall feel, and then going through it again with the working Jess command shell, editor, and command line in front of you. Or an IDE if you must. :-)
Jess itself consists of a rule language, a runtime engine which supports forward and limited backward-chaining, and APIs for integration with Java; there are many add-on tools for Jess, referenced throughout the book. As with most rules engines, rules are specified as declarative patterns, not procedural code.
Jess in Action is well worth your time and attention, at the least for its exploration of rules, and at most for presenting a strong, flexible platform to tackle what is probably one of the uglier parts of your development process: the sequencing and parameterization of business decisions. Although the list of Cons below is longer, they're just nit-picking; this is an excellent, entertaining, and productive read that will likely expand your programming horizons considerably.
Pros- Clearly, concisely, and entertainingly written for Java programmers of any background
- A strong introduction to two important topics: rules and declarative programming style
- Well-chosen and developed working examples, each with a different design style
- The description of the author's unit test framework for rules in Appendix C is a nice touch
- Early discussion of Jess syntax focuses too much on Java-like procedural style
- More of a tutorial - not long enough to be a good reference (though that would probably require a detailed Jess Patterns book)
- Discussions of development methodology and knowledge engineering are unnecessary, as they're covered better elsewhere and a short summary adds little to the book
- There's no single list of rule and Jess-related links; references to tools and discussions are scattered throughout the book
- There are no general references to rules and rule-based systems for theory and background
Simon P. Chappell's review While part one of the book has two slim chapters to introduce rule-based systems to the casual reader, the rest of the book is a no-messing user guide, reference manual and tutorial on using Jess. If you want to learn about rule-based systems, this should not be your first book. If you know of rule-based systems and have decided to use Jess, then run, don't walk to the bookstore and purchase a copy of this book.
I liked the solid, yet gentle, progression through part two, where the basics of using Jess are explained. The explanations were clear and each concept was introduced in a sequence that built upon the previous concepts and information. For example, I had thought that rules were all you had to worry about in rules-based systems, but it turns out that because rules operate on facts, designing the representation of those facts is a pre-condition of designing rules. (Right, I know you knew that, but it was new to me! :-)
Parts three through six are complete case-studies of the application of Jess in increasingly complex applications. The examples are well-explained and the rationale for each step is discussed in sufficient detail to educate but not bore.
Part seven is a self-described 'grab bag' of stuff that didn't fit in any of the other parts of the book. This section spends some time looking at using XML with JESS, including markup languages for rules, and interfacing with Jess from EJBs and Application Servers.
Lastly, there's the fact that the author of the book is also the author of the software in question. Dr. Friedman-Hill obviously knows Jess better than anyone else in the world and this shows through in the way that he not only explains how to achieve activities in and with Jess, but he also takes time, here and there, to explain some of the design decisions and trade-offs in its creation.
You can purchase Jess in Action from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the (recently updated) book review guidelines, then visit the submission page.
"If I have any complaint about the organization, it's that the book could have been even more example-driven, abandoning (or shortening) the chapter on syntax and basic functions and introducing them only when used in an example; the rest could have been left to the appendix of Jess functions."
:)
:)
To me this says that O'Reilly's methods for writing programming books is favoured to other styles. Personally, I love how O'Relly's PHP Cookbook does just what this reviewer is looking for. You get a problem, a solution and examples to go with it. The zen of O'Reilly how-to books.
I'm not a Java programmer, but I might have a look at Jess. To me, Java is fairly redundant. I don't like it very much because it's not thin. I'm a bare-bones kinda programmer. Cut, cut, cut!
Using Java in college, you had to load all sorts of extra libs you might not use, which seemed wasteful to me. Don't get me started on web applets, which is what they taught at school. How to turn someone off Java? Applets!
Jess seems, at first glance, to be equally as redundant. Perhaps some of you could delve into the benefits of Jess, on my account?
on the Java Website.
'based on the Chapter 13, "Adding a graphical interface," of the book Jess in Action published by Manning Publications Company. Test your knowledge of Jess, the rule engine and scripting language for Java technology.'
When anger rises, think of the consequences.
Confucius (551 BC - 479 BC)
3. What are the licensing issues surrounding Jess?
Jess is and will always be available at no cost for academic use worldwide, with an appropriate license. Commercial users can purchase a Jess license by contacting Craig Smith at Sandia's Technology Transfer office (Telephone 925/294-3358; email: casmith@sandia.gov.) The licensing fees are negotiable and generally quite reasonable. You can also purchase an inexpensive "Home Office" license. Jess is not licensed under the GPL, the LPGL, the BSD license, or any other free software or open source license. Redistribution of the Jess source code under any free software or open source license is prohibited.
Chappell points out that the book's author is also Jess' creator, so he speaks from authority.
And without bias, I'm sure. =P
I should have known it was a mistake before I hit the "search" button, but I had searched for "Jess in action" on Google, and gotten not quite what I wanted.
Pardon my curmudgeonry.
Sheesh, evil *and* a jerk. -- Jade
Fix the rating please. It's the same as the ISBN.
No, that's the rating. It's a *really* good book!
The book is not a review of the pros and cons of Jess, it is an instructional guide. If you bought this book you either already have a Jess implementation or are seriously considerig one. The bias of the author is as irrelavent as the bias of a Ford engineer writing the product repair manual for a F-150.
Rules technology is pretty powerful, but like everything else, you have to know what you're doing. The most common mistake is when a programmer tries to use rules engines in a procedural manner like VB. One area where rules engines are used in production systems is business process management, like processing insurance or handling loan approvals.
Drools is another rete based rule engine with a java implementation. It has more flexible licencing.
Asmo
That's simply a coincidence. The book really is that good.
Cheers,
Ernest Friedman-Hill
ich muß mehr Kuhglocke haben
No. It is just rating inflation run amok.
Just when you thought it was bad when every book was a "9", now we get a "1930110898".
Are you implying that beacuse it is a commercial program that we should not be promoting books about it? Oh, yea, its beacuse Java is open source... not.
Referral Link:
Amazon has this book for $5 less than bn and with free shipping
That's just coincidence. It really is that good.
Just curious -
have any of the slashdotters used rule-based frameworks for real-life projects?
What do you think about Java Community Process Rule Engine JSR?
What about frameworks that try to keep things simple, like Ruleaid?
Would be nice to have something like this
for the regular *nix environment.
*raised eyebrow*
Do I really want my web-site to Drool?
Jess is very handy, don't get me wrong, and the Java API is great except for one large omission:
Right now the jess.Defrule class does not expose enough public methods to properly create one outside of the jess package.
That's straight out of the latest Jess documentation. You can't construct rules from Java! Well, you can pass a text string to Rete.executeCommand, but this is hardly elegant. Grrr... Am I missing something here? If not, then PLEASE give me a constructor for Defrules, Mr. Friedman-Hill.
It's getting frustrating enough that I've been interested in an open-source alternative to Jess (academic license is no charge, but you have to pay for it for commercial use): drools. This has to be the dumbest project name ever, and I haven't even looked at much of the code yet, but it looks promising. Anybody have any experience with it? Please hold back your drool jokes for now...
"Now gluttony and exploitation serves eight!" - TV's Frank
deja vu
-- ac at work
Then you can just use the stable and mature "CLIPS", a C rule system like a Lisp one of yore, but without the Lisp.
(Or roll your own in Common Lisp, it takes about 20 minutes.)
Can anyone tell me if this Jess is related in any way to the JESS language that runs Warcraft 3? ;) They are not exactly the same but I'm trying to figure out if, say, the WC3 version is in any way based off Jess.
Should you wish an alternative to the commercially-licensed JESS, Stanford has its own Java Theorem Prover, DAML-compliant and capable of handling forward- and backward-chained reasoning. Object code can be freely redistributed.
"Freedom is kind of a hobby with me, and I have disposable income that I'll spend to find out how to get people more."
As a person named Jess, I have to say this is the best Slashdot story I've seen in years!
Although I am a bit disturbed to find out that Ernest Friedman-Hill is in fact my creator. Mom's got some explaining to do!
If you are an american citizen or an american corporation, you ought to be able to file an FOIA request for the source. The software was built with your US tax dollars and is maintained with those same tax dollars, you own it unless they can make a good case that there's a public health or national security issue that overrides that -- which is doubtful.
even if a FOIA were to succeed, you would still not have the right to use the source code in production or redistribute it...
Implementing rule-based programming in Java is like putting lipstick on a pig (if you don't know, rule-based programming is the lipstick). It is best to leave rule processing to a language designed for it and use Java for other tasks for which its better suited, such as interaction.
"Nobody bothers to read the comments" -- cmdrTaco
do you honestly think that moderators are going to look at every poster's history before they mod? You're pretty dumb...
Also, did it occur to you that some people find pricing information informative, even if a referral link is used? (If you want amazon to keep that $1 commission instead of paying it out, go straight to amazon.com and don't click on the link. If you want that money yourself, sign up at associates.amazon.com. If you're boycotting Amazon, don't click and don't buy.)
My favorite is Mandarax. It's a Java-based backward chaining rule engine with excellent documentation. I've found it to be fast and extensible. And even better, it's LGPL!
This solution isn't for you.
But, It works for anyone else with a current Java CROSS-PLATFORM application to support.
Prolog is a back-chaining system (quite mature), JESS is mostly forward chaining (though I understand they can do back chaining too.).
The implementation language is unimportant. The fact that it runs on any platform, and its integration with Java for enterprise apps is important.
While rule based systems are not new, they are now being rediscovered to house business logic in a mid-tier.
IMHO much of the value of a rule engine stems from the strict separation between business logic and enterprise programming (e.g. transactions, dbs, etc.) FORCED on you be the discipline of a representation change.
Just curious. Why do you think Java is ill-suited for rule processing?
DevX.com has an interview with Dr. Ernest J. Friedman-Hill inwhich he talks about its (JESS) development and what the next steps are.
And you're the expert on this.
IBM's WebSphere seems to be doing pretty well.
ORacle's database seems to be doing ok.
WebLogic and Borland are healthy.
Only Sun, not experiencing big server sales lately, is hurting.
But, Microsoft, is selling a buggy copy of java you can get.
that many searches pull up prorn is not funny
Jess seems, at first glance, to be equally as redundant. Perhaps some of you could delve into the benefits of Jess, on my account? :)
A rules engine like Jess or CLIPS allows you to express a set of rules very economically, expressively, and readably. It's not right for everything, but in many situations it allows you to do things that would be practically impossible if you expressed the same thing as if/then/else statements in code. For example, in a situation where rules need to change frequently, it's great to be able to allow an expert user to edit the rules which can live somewhere outside the code. If you find yourself recompiling frequently to suit the fickle whims of a user who wants some kind of rule changed, a rules engine can be a huge time saver.
I originally reacted to Jess much the way Black Parrot did, knowing that rete-based rule engines have been around since 1989 or so.
Jess is a rete-based rule engine, but the implementors have done a lot of work on the innards of rete network processing and have made serious order-of-magnitude improvements in matching speed.
{snipe}
They had to - Jess would have been too slow relative to rule engines in native-compiled languages otherwise.
{/snipe}
Seriously, Jess is a real improvement over ancient and revered rule engines like CLIPS. You can find out more about Jess by going straight to the sources at Sandia Labs here.
To a Lisp hacker, XML is S-expressions in drag.
And despite the "cross-platform" compatibility of Java, few corporations use it to their financial benefit. (Please, no posts from individuals who have ported a Java app from one platform to another).
Prolog is a back-chaining system (quite mature), JESS is mostly forward chaining (though I understand they can do back chaining too.).
My post was not about Prolog per se, but about the many Prolog- and Lisp-based rule engines available (A detailed aside: a forward-chaining rule engine can be written in Prolog easily).
The implementation language is unimportant. The fact that it runs on any platform, and its integration with Java for enterprise apps is important.
Funny that you say the implementation language is unimportant in the first clause of this sentence and then contradict that in the second clause.
IMHO much of the value of a rule engine stems from the strict separation between business logic and enterprise programming (e.g. transactions, dbs, etc.) FORCED on you be the discipline of a representation change.
You're dead wrong here: transactions and database rules are part, if not the major part, of business logic. The only way to force discipline is to write rules in the database and then allow users and developers access to the database through well-defined paths/rules/procedures.
Can someone give me a good summary of what a rule-based system is and what it's used for?
JEOPS is another pure Java rule engines available under LGPL. It can be found here
It may have 'more flexible' licensing, however it is non-free: 'Jess can be licensed for commercial use, and is available for academic use.' This is not a problem per-se, I'm just a little surprised that this article is nothing more than an advertisement for a book on a non-free, commercial piece of software...
Why do you think Java is ill-suited for rule processing?
I didn't say that, but your statement is true: Java is ill-suited for rule-processing because there is no question that it cannot compete with languages designed for that purpose. Its a matter of what a language is suited for:
So as a language, Java has a rather checkered history. It has found a niche (WWW servers) and is finally doing well there, but it has been a long, bumpy ride for old Java programmers (see the Official Unofficial Java History for details.)
In contrast, Lisp and Prolog were designed as symbolic manipulation languages and do that exceedingly well.
But my main point was "why would one perform a task in Java that can be more easily, more quickly and more cost-effectively done in a readily-available language designed for the task?"
And when I say server farm I mean several dozens of servers. And several hundred thousand lines of code.
Oh yeah - they also found a massive performance improvement switching from NT to Linux.
Almost forgot! They are using Blaze, which is a Java-based rules engine.
#man woman
segmentation fault - core dumped.
The post to which you responded to anticipated your response, but you did not read it:
(Please, no posts from individuals who have ported a Java app from one platform to another).
Do you consider yourself a typical Java developer? If that is true, then Java is indeed in trouble.
GNU Prolog Java
JavaLog
More Links
Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
Walk into just about any shop that uses java and you'll probably see a bunch of people coding on Windows boxes. But it's doubtful you'll see their apps running on MS platforms. Every company I've worked with has had this same setup. That's a pretty straightforward example of using java's cross platform capabilities.
When I saw your original post I thought, "Uh oh, he's going to get slammed," and I see I haven't been disapointed. Bloody shame that.
You were formally trained in an age when computer science was still part of the science department and not the business trade school department. Your concepts of programming are thus founded in the logic and mathmatics behind the languages and "apps."
Modern programers who are in "Enterprise" computing aren't even going to understand a single word you say, nor are they likely to care to.
The whole structure is ad hoc (just look at Java itself. Yech) thrown together and driven by the commercial interests of the vendors, not the customers, and thus not even the logic inherent in the problems to be solved.
If Turing, Von Neumann and Codd showed up here to try to explain things they'd get modded down as flamebait.
Normally I'd say forgive them, they know not what they do, but we're talking about a culture in which I find it hard to forgive what amounts to wilfull ignorance.
To the extent that they're really tradespeople and a product of trade training I suppose they can be forgiven, but I'd hope they'd pick up a book once in a while that explains what they're doing rather than just books about the practicum of trade.
The "lab" work is supposed to be built on top of deeper understanding.
Well, I shall soon be joining you in "flamebait hell." Save me a barstool, will you? We'll talk.
KFG
Why managers still insist we use JMS instead of Erlang or Jabber?
Why managers still insist we use EJB even when a single container is enough and no load-balancing required?
Why managers still insist we use Oracle for databases with 10 tables of 1000 records each 100 transactions a day?
Why managers still insist we use MS Exchange server when we don't use anything besides email from it (no tasks or calendars, no public folders)?
Why managers still insist we use ... wait a minute, now I know "why" - because of managers, they still have no brains in the head and no honesty in the heart. That's why.
Less is more !
I'd just like to add that much to its detriment, Jess is absurdly expensive to license for commercial use. We're talking Oracle Server price range here, which I think is fairly ridiculous for what you get. I hope Sandia will wise up and realize what an impediment this price is to establishing a commercial base. My guess is that a fair percentage of users decompile the demo version of Jess and remove its 30 day timeout...
It plays all the SNES roms I have.
Rules engines at best are competent beginners in a limited, structured domain. Discovering and programming the rules is a process requiring a very significant investment of time and effort, including both technical and business experts. "more difficult and important is the twofold task of knowledge acquisition: finding articulate, self-analytical experts who know why they do things, and developing efficient techniques for extracting what they know and distilling it into rule bases. The essential prerequisite for building an expert system is to have an expert." In most cases, experts don't in fact use the rules that might be discovered by interview and reflection. Rules are always context free and cannot take into account the relevance of facts.
Rules engines can't handle exceptions that are not programmed in. Rules engines apply their rules ceteris paribus, assuming that everything not accounted for in the rules is constant, when if fact the unaccounted-for variables may in fact be the important ones. Expert human collaboration and judgment is required to correct and update rules engine errors.
The ongoing maintenance of rules is a significant effort and drain on resources. In a rapidly changing business, the value of the rules degrades rapidly without maintenance.
Deskilling of workers is a significant risk in heavy reliance on rules engines. As more business expertise becomes embodied in the rules engine, the ability of the workers to understand the domain becomes less.
Recommended readings include:
despite the "cross-platform" compatibility of Java, few corporations use it to their financial benefit.
My reply showed how a large corporation is using the cross-platform compatibility of Java for financial benefit. This is not an example of an individual (me) porting a Java app. This is an example of an app requiring no porting, because it is already cross-platform compatible. The institution in question will save thousands of dollars: 44 servers * ~$3000/server/year = $132000 per year (approx), purely by taking advantage of Java's cross-platform compatibility.
And, yes, I do consider myself a typical Java developer, one of a mere 3-5 million or so.
#man woman
segmentation fault - core dumped.
Please notify your employer of your termination and kill yourself.
Jeez, I could hope there weren't many more Java developers as stupid as you, but if there are 3-5 million Java developers, that means that at least 1-1/2 million Java developers have an IQ of less than 100, which is a piss-poor situation. You are easily below the -2 S.D. level; barely able to write.
I think the licensing issues are annoying enough - I could get an academic license as I teach at a university, but when (a while back while I was "under" employed) I tried to get a version so I could do some experiments (I wanted to try using it as a bit of support software for a volunteer organization even) and maybe use it in classes at some future point and discovered the licensing was going to make that impossible.
Oh well. Count me down as someone who will not even discuss Jess as a possibility in my classes.
He was not arguing that Java's cross-platform capability was not useful.
The point was that other languages, i.e., Common Lisp and Prolog, are better suited for rule-based programming than is Java, and that those other languages are available and run cross-platform too.
Seems the Java boys need artificial intelligence badly!-))
Know about any other books or downloadable papers that provide an introduction to the theory behind rules engines and/or the Rete algorithm? I haven't been able to find anything useful on the web. Any search turns up sites hyping their own product.
---------
There is inferior bacteria on the interior of your posterior.
The Rete algorithim (Rete: A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem by Forgy in Artificial Intelligence 19, September 1982) is an efficient solution to a problems given in a specification that should never be used because of conceptual nastiness.
The attractive promise of declarative rule-based systems is that each "fact" (base or implicational) in the problem domain can be stated as a rule. But this is hardly the case in Rete based systems.
The Rete algorithm was designed to efficiently implement the non-monotonic forward chaining "blackboard" paradigm. A Rete inference system has a "blackboard" of facts that a large number of rules monitor, and when the some facts on the blackboard match the condition of a rule, the rule can fire and add information to the blackboard (monotonic) or change or delete information from the blackboard (non-monotonic). The main conceptual issue in this sort of system is what to do when the blackboard satisfies more than one rule. The problem is that firing one rule may change the blackboard so that another rule that could have fired can no longer do so. So Rete ranks the applicability or rules.
Thus a blackboard system winds up with rules whose meaning is not just contained in a rule but has to be inferred from all of the other rules that might be fired by similar input conditions. Most Rete based applications I've looked at wind up using the blackboard to essentially implement program counters to control program flow. And in general, adding a new rule may generate new solutions but it also may break prior solutions.
Pure monotonic systems (with forward and/or backward chaining) are conceptually very easy to analyze because all of the "facts" are truly independent.
One can add a form of non-monotonic behavior to monotonic systems by ranking their solutions. E.g. a monotonic system generates N solutions but ranking via some ordering prunes these down to say 1 or 2 best solutions. This external ranking is non-monotonic because adding new facts to the monotonic part may result in different "best" solutions.
So, basically I am advocating an inference system which is conceptually defined as results = rank(infer(facts, data)). If these functions have good mathematical definitions then it may be possible to implement their combination so that ranking controls or happens during the inference process but the results look as if it was external, and thus one avoids the computational horror of over-generation by the "infer" function.
Rete however explicitly and globally performs the ranking process during inference and an arbitrary Rete rule set is probably NP complete to analyze. But maybe a good implementation of a conceptual separation of "rank" and "infer" could be realized by a Rete-like network.
Wow, this book got the highest rating of any review I've ever seen on /.
(For those that didn't look it's rated 1930110898)