Hi Brett,

While I don't know if there is a methodology for "Refactoring" code into
facts and rules, that doesn't mean  it doesn't exist. However, I will give
an opinion of how to attack the problem.

1. The "good news" is that the existing system will provide a working model
of your requirements. The "bad news" is that you may be just "rebuilding the
same system" (with all of its warts and flaws).

2. A rule engineering technique would be the first priority - you might want
to look at "Business Rules Applied" by Barbara Von Halle. While it may not
have explicit steps for a particular rules engine
(JESS/JRules/OPSJ/Advisor), her STEP process can be used (with certain
additions and modifications) as a rules engineering methodology.

3. To ensure that the members of your team understand the techniques of
engineering the situational logic found in rules, I would look at
http://www.econ.kuleuven.ac.be/prologa/ (Prologa decision table system by
Van Thienen).

4. At some point, you will have to extract the "if then ... else ..."
statements from your existing code, sort it out and group the logic with
respect to the "business goals". This is where the Prologa system helps to
understand how your code snippets begin to form logic patterns. I worked on
a system that had extracted 30,000 such statements - it was not a trivial
task to understand how the business logic worked just by looking at the
collection of such statements.

5. Once the rule logic patterns begin to emerge via the decision tables, you
will have to formulate "control logic" to (possibly) preclude unwanted
forward chaining which can occur. This also defines the "business logic"
from a "procedural" perspective as found in your original code.

6. As the rule-based system design emerges, it is then possible to do a "gap
analysis" between the old system and what you want in the new system.

While this explanation is (VERY) short, I hope it helps to get you started.

Rich Halsey

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 8:38 PM
Subject: JESS: Porting procedural code to Jess


> Hi All,
>
> I notice a lot of discussion about green fields rule based application
development on this list but not much on replacing existing legacy systems
with a rules based implementation. In the real world of business systems
development, I'd have thought this probably more common than implementing
green fields.
>
> We are looking to port legacy C code to Java and move procedural business
rules into Jess.  The code contains very complex classification algorithms
using many if-then-else statements. As usual the documentation is almost
non-existent.
>
> Is there a methodology for "Refactoring" code into facts and rules?  Are
there any tools available that could help? Can anyone share their
experiences porting legacy code and recommend an approach?
>
> Best Regards,
> Brett Daniel
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> (use your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------
>

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to