Manning Logo
Home | Ordering Info | Shopping Cart | Manage My Account | Login
Attention customers: online shopping is now available exclusively through our main website: http://www.manning.com. Thank you.
Jess in Action

Inside the book

Back Cover Sample Chapters Table of Contents Errata Author Online Index Preface Reviews Source and Jess SE Author Online

Manning Blog

Why small is sweet?

Author Blogs

Dave Crane more...

Author Calendar

Upcoming Events

Catalog

Java .NET Perl XML All by Subject All by Title

About...

Manning Contact Us Ordering FAQs ebooks Covers Sandbox Forums Distributors Manning Early Access Program (MEAP) Affiliate Program Academia/Publicity User Group Program Press Releases Jobs

Manning Publications Co.
209 Bruce Park Avenue
Greenwich, CT 06830

Jess in Action
Java Rule-based Systems
Ernest Friedman-Hill

2003 | 480 pages
ISBN: 1930110898
$49.95 Softbound print book  
$25.00 PDF ebook  

Preface

In 1994, I was working in the Scientific Computing department at Sandia National Laboratories in Livermore, California. We had an impressive (for the time) array of heterogeneous computing equipment: workstations from Silicon Graphics and Sun Microsystems, Intel PCs running Linux, Macintoshes galore. I was writing software agents that managed dynamically distributed computations across this network. Agents were running on each machine, and they used a sort of “post and bid” method to decide which machines would run which piece of a computation, based on machine capabilities and load balancing. The agents were fairly intelligent in their decision-making capabilities, and the plans they developed were sometimes surprising. Their “brains” were rule engines—software systems that used rules to derive conclusions from premises.

That project led to others, and soon I developed an interest in mobile agents—software entities that can travel from node to node in a computer network, maintaining their state as they go. Thus was born the idea for a rule engine whose state could be packaged up, sent across a wire, and reconstituted. The newly released Java language seemed to be a perfect vehicle for this rule engine—and such was the origin of Jess™, the rule engine for the Java Platform.

Jess is a general-purpose rule engine, developed at Sandia National Laboratories. Written in the Java programming language, Jess offers easy integration with other Java-based software. Jess is free for academic and government use, and it can be licensed for commercial use. You can download a fully functional Home Edition of Jess free of charge if you own a copy of this book (see chapter 3 for download instructions). You can use the Jess Home Edition for noncommercial purposes.

Jess has evolved quite a bit since its original introduction in 1997, largely in response to feedback from a global user community. I’ve enjoyed working on Jess the whole time, and look forward to its continuing evolution in the future.

about this book

This book was originally conceived in August 2001. As I write these words now in May 2003, I feel like I’ve stayed quite close to the original concept for the book. Then, as now, despite the still-growing prominence of rule-based systems in nearly every field of software development, the few available books on the topic were heavily theoretical and lacking in real-world examples. With this book, I set out to change that pattern. The book you’re holding is structured around a series of large, fully developed, and eminently practical examples of rule-based programming in Java.

This book can be used in several ways. First, it is a general introduction to rule-based systems. If you’ve never encountered rule-based systems before, you’ll want to read part 1 closely. This first section of the book introduces the concepts behind rule-based systems, discusses their applications, and shows some first examples of rule-based programs written with Jess. Part 1 also discusses what’s involved in adopting a rule-based solution at your company. Although the programming examples in later chapters use Jess as a vehicle, the concepts presented will transfer to other rule engines easily.

Second, this book is a programmer’s manual for the Jess rule language. Part 2 is part Jess language reference and part tutorial. It first introduces you to the language, and how the language is integrated with Java. Later chapters in this part discuss rules and working memory elements—the data that rules operate on. There’s also a chapter describing some of the theory behind Jess and what makes it run fast.

Finally, this is a cookbook for real rule-based systems. Parts 3 through 6 describe substantial, realistic software systems in enough detail to teach you how to develop similar systems on your own. Each part presents a rule-based system of increasing complexity, and also introduces new programming techniques:

  • Part 3 presents an information kiosk, the Tax Forms Advisor, that helps customers choose which income tax forms to bring home. You’ll learn how to collect expert knowledge and condense it into rules. The kiosk as presented has a simple text-based interface.
  • Part 4 is concerned with the development of the PC Repair Assistant, a help-desk application with a Swing-based graphical interface. This example builds on and extends some of the software infrastructure developed for the Tax Forms Advisor.
  • In Part 5, I’ll guide you through the development of the HVAC Controller, an intelligent climate-control system for a hypothetical office building. This part shows how rule-based systems can be interfaced to hardware. A special section written by Bob Orchard, developer of the FuzzyJ toolkit and the FuzzyJess extension for Jess, shows how the HVAC Controller can be enhanced by the use of fuzzy logic.
  • Part 6 is about web-based e-commerce solutions. This part presents a Recommendations Agent that analyzes a customer’s past and present purchases to recommend additional items of interest. The Recommendations Agent is embedded in a set of servlets and JavaServer Pages in the Tomcat servlet engine.
  • Part 7 is a little different. The two chapters in this last part cover various topics relevant to using rule-based systems in enterprise applications, including using XML as a rule language, and working with application servers, Enterprise Java Beans, and the J2EE environment.

The main text does not try to be an exhaustive guide to all of Jess; instead it concentrates on those features relevant to the example applications. The first two appendices provide some additional detail. Appendix A includes a description of each of the functions built into the Jess language, and appendix B presents the highlights of Jess’s Java APIs.

The development methodology used in this book emphasizes testing. Appendix C presents a simple automated testing framework that can be used to test Jess applications. The code for this framework is available from this book’s web site.

Who should read this book?

Because this book can be used in several different ways, it has several distinct possible audiences. Part 1 is an introduction to rule-based systems for any student of information technology, practitioners and management alike. The later parts of the book are aimed squarely at programmers. I’ve assumed an intermediate knowledge of the Java programming language throughout. Occasionally I explain a Java concept, but most of the time, I just imagine that you understand.

The audience I thought of most as I wrote are intermediate Java programmers with little or no exposure to rule-based systems, who are interested in getting that exposure.

This book is also suitable as a text for a university course on practical rule-based systems development. The course prerequisites should include a course on Java programming. The course content would include parts 1, 2, and 3 of the book, followed by either part 5 or part 6. Additional material could be used as time permits, of course.

Source code downloads

The code for all the major examples and applications in this book is available from the book’s web site, www.manning.com/friedman-hill. You can also download a special version of Jess from this web site.

Typographical conventions

This book includes listings of code in both the Jess and Java languages. It also contains transcripts of interactive sessions at the Jess prompt. All of these are set in monospace type. Keywords, function names, variable names, and symbols in any language are also set in monospace when they occur in the main text. It is generally clear from context whether I’m talking about Jess code or Java code, because the two don’t look much alike.

In the interactive session transcripts, the Jess prompt and things that you enter are all shown in normal monospace type, while responses printed by Jess are shown in italic.

In step-by-step examples, text that you are to type appears in bold.

DESCRIPTION

Imagine a different way to program in which you specify rules and facts instead of the usual linear set of instructions. That's the idea behind rule-based programming. A rule engine automatically decides how to apply the rules to your facts and hands you the result. This approach is ideal for expressing business rules and is increasingly used in enterprise computing.

Jess is a popular rule engine written in Java. It's supported by Sandia Labs and has an active online community. If you have a problem that can be solved with rules, Jess in Action will show you how. (If you are not sure, read chapter 2.) Written by the creator of Jess, this book is an accessible and practical guide to rule-based system development in Java.

Jess in Action first introduces rule programming concepts and teaches you the Jess language. Armed with this knowledge, you then progress through a series of fully-developed applications chosen to expose you to practical rule-based development. The book shows you how you can add power and intelligence to your Java software.

What's Inside

  • Introduction to rule-based thinking
  • Jess language tutorial
  • Complete examples of ...
    • Tax forms advisor
    • Diagnostic assistant
    • Fuzzy logic controller
    • Web agent
    • J2EE apps

Includes binary version of Jess ( for non-commercial use)

ABOUT THE AUTHOR...

Dr. Friedman-Hill is a Principal Member of the Technical Staff at Sandia National Laboratories in Livermore, California. He is the developer of Jess, the Java rule engine. He has taught Java programming to over 3,000 students for the University of California Extensions in Berkeley, in San Diego, and online. Dr. Friedman-Hill's current work at Sandia includes the development of software for mechanical design and analysis. He lives in Gaithersburg, MD.

Ernest Friedman-Hill Interview

Read Jason Morris's interview with the author of Jess in Action.

Home | Catalog | Privacy Policy | About Manning

© 2003-2006 Manning Publications Co.