• Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing business rules in java...  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write an interface that implements business rules. How are
the rules usually stored in a java application? They don't want to use a
database here.
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Brashear:
I am trying to write an interface that implements business rules. How are
the rules usually stored in a java application? They don't want to use a
database here.


I put them in a MySql database.

You could put them in Properties files. But as the rules get more complex, you often need to put in logic, variables, etc. so why not write the rules in Java? You can dymanically load the class files to vary the rules.
 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you put them in a java file, wouldn't need to have a code push if
a particular rule set changed?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can consider using a rule engine like Jess (see my signature.) Jess gives you a lot of flexibility as to how rules are stored; a flat file is one option. You can modify rules dynamically without changing any Java code, but you have a powerful programming language to use which can use all the Java APIs.
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Brashear:
If you put them in a java file, wouldn't need to have a code push if
a particular rule set changed?


Of course. You need to reload the class file to make the new code take effect. True no matter how the code is delivered. If its in a database, you have to clank the database.

How one detects which rules have changed is left as an exercise to the user.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!