Business Rules in Java or Database?

Gustavo writes in to ask how to migrate Oracle Forms business rules, for example when using JHeadstart Designer Generator. In case all business rules are
inside the Forms application, do you translate every business rule to the appropriate "spot" in
the ADF BC Framework or do you use CDM RuleFrame?

The answer is: it depends! Each solution has its pros and cons, and it depends on the circumstances which choice is best. I'll describe some characteristics, you can decide for yourself which are advantages and which are disadvantages, and how big a (dis)advantage it is. The characteristics not only apply when migrating Forms to Java, they apply in general when deciding where to put business rules when building a Java application using ADF Business Components on top of an Oracle database.

Characteristics of using ADF Business Components for business rules

  • Needs Java skills
  • Needs Oracle JDeveloper and ADF Business Components
  • The rules are enforced for each application that is based on these ADF Business Components (including JHeadstart-generated applications)
  • Usually faster user-feedback than business rules in the database
Characteristics of using CDM RuleFrame for business rules
  • Needs PL/SQL skills
  • Needs Oracle Designer and iDevelopment Accelerators
  • The rules are enforced for each application that is based on these database tables and that opens/closes CDM RuleFrame transactions and knows how to display CDM RuleFrame error messages (this is no problem for JHeadstart-generated applications: just turn on a built-in feature)
  • Usually slower user-feedback than business rules in the application server

Comments:

As an additional factor in deciding where to implement the business rules, you should also consider whether there are any needs for batch processing apart from the UI (that would typically feature more record-level transactions). In a batch process, the most important requirement is probably the speed by which large volumes can be processed and depending on the actual rules, they might be implemented in PL/SQL for batches of records to improve performance. For an ADF/JHeadstart user interface, records are typically handled one by one or just a few at a time and there, business rules can be implemented more 'closely' to the business (by a business user rather then an PL/SQL expert) at the record-level. Both CDM RuleFrame and ADF BC offer an expressive toolset to implement business rules at the record-level, but because they enforce each rule on individual records, they have an impact on the throughput of batch jobs (if you choose to use these technologies in the batch process). Therefore, it's often important to take a close look at the batch sizes, throughput requirements and actual rules. If the performance requirements aren't too strict or you can meet the requirements with appropriate hardware investments, defining the rules at the ADF BC level or in CDM RuleFrame, is probably the most expressive and easy way to implement the business rules. If performance is an issue, you'll probably have to implement the rules at the DB level. Depending on what you know about the quality of the input data, you might also enforce all business rules at the ADF BC level and just duplicate those few rules that are actually relavant to batch-loaded data in PL/SQL in your loading procedure. Best regards, Benjamin

Posted by Benjamin De Boe on December 16, 2007 at 11:36 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Java EE Consultants - JHeadstart, ADF, JSF

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today