dbTalk Databases Forums  

Business Rules

comp.databases.theory comp.databases.theory


Discuss Business Rules in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lars Tackmann
 
Posts: n/a

Default Business Rules - 03-27-2008 , 07:22 AM






Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored procedures and constraints ?.

I am not on the lookout for a complete solution, I simply see allot of
business rules like the ones defined above, but never a clean
solution to maintaining them (perhaps a DSL or a rule engine is the
way to go).

Any feedback will be greatly appreciated.


--
Yours sincerely

Lars Tackmann

Reply With Quote
  #2  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM






On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #3  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #4  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #5  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #6  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #7  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #8  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #9  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
  #10  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Business Rules - 03-27-2008 , 08:50 AM



On Mar 27, 5:22*am, Lars Tackmann <ltackm... (AT) gmail (DOT) com> wrote:
Quote:
Hi

This is a recurring question here, but I have read through the archive
and failed to find a answer so here goes.
Consider the following use cases:

- When a customer purchases product A he automatically gets product B
- Product C can only be bought with product A (either if you have A
already or in the same order)
- Product D cannot be bought with C
- When you purchase X number of product type E then you can not
purchase more than Y of product type F
- A certain product combination (number and types) should yield a
discount.

as seen there exists the concept of a single product and that of a
product type (family of products), the business rules should be able
to work on both single products and on product types. The question now
is how best to deal with such rules from a DB point of view, is there
a relational design general enough to cope with such rules ? or do I
have to resolve to stored *procedures and constraints ?.
In theory, the any database constraint is an inequality

E1 <= E2

where E1 and E2 are RA expressions involving database relations. In
logical programming terms the partial order <= is the familiar
implication symbol.

In practice, there is a lot of technical details to work out no matter
what approach would you take, being that constraint enforcement via
triggers or via ANSI SQL style assertions (implemeted as check
constraints on materialized views).

I suggest that any rule-engine technology that does not naturally
embrace databases would give you the most headache. There is a reason
why rule engines never being able to crawl out of their tiny niche and
enjoy wider adoption.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.