A single query business rule per table or multiple

Eric K3
Kilo Guru

We have query business rules, one per table (INC, RITM, CHG, etc.), that limit query returns based on various conditions such as user hasRole, or is a member of a group. In these query BRs, we use scripting and multiple if - if else statements to accomplish our needs, but the scripts are becoming much more complicated with every additional if condition that our management requires.

My question is: is it better to continue keeping all the logic in one query business rule per table, or can we/should we use multiple BRs per table, which will allow for simplicity and easier comprehension of the logic?

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

I would suggest one query per table instead of multiple queries.


It will become more complicated, if you use multiple business rules.



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

I would suggest one query per table instead of multiple queries.


It will become more complicated, if you use multiple business rules.



Please mark this response as correct or helpful if it assisted you with your question.

Shishir Srivast
Mega Sage

I think you have different business rules per table and that would be good to maintain.


dmaze531
Kilo Expert

I second Sanjiv. One rule judiciously commented would be better.



You may already be doing this, but don't forget about ACLs as a means to control your read, modify, delete. Users can belong to more than one group. You could easily create a new group such as "Table1 Read Access Access Group" with a custom role of table1_read_access. Then add the users you want to limit read access for this table.