Business rules inside the dabase - how to avoid

Dears,
I have a friend who is working on our project and he is an
Oracle DBA. The problem is that he's been very stubborn when it
comes to the app's business rules. He insists that all of the
business rules should be inside the database, represented by
triggers, stored procedures and the likes.
Even the applications's parameters should go into the database,
according to him. "Property files ? Hell no !"
I tried to convince him of the importance of OO design principles,
abstraction, blah blah blah but he won't listen.
Does any of you guys know of a link or an article available on
the web that addresses this discussion ?
I wanted to persuade him, instead of forcing him to accept our
design decisions.
I mean, I know we all have to be reasonable but I wanted to
have something written by some of the OO gurus, it would be
easier...
Thanks a lot

Finding a case study for what you speak will not be easy, and I suspect will do little to sway the opinion of your DBA. If you do find something, please post it to the list here.
Here are the fundamental problems with his approach (feel free to use these arguments against him):
1) Business logic is hidden / spread across multiple tiers. This is a biggie. If you are using triggers, etc you have business logic that is spread across both the actual code level and across the DB. For a developer that is going to implement a change you have effectively doubled the cost of that change. Plus your development team has to be well versed in both Java coding and in SQL / DB specific coding as well - if your DBA is doing proprietary things in Oracle... well, you get the picture.
2) Changes to DB. If you ever change DB solutions, or even want to switch to a new set of tables, you have to replicate all of that work. There is no real reason for doing that with todays technology - you are just creating more work and making your system(s) less flexible to change and more challenging to migrate.
3) Object / DB disconnect. When you get into the guts of things, there is a wide gap between what is considered best practices for DB design and what is considered best practices for OO design. This culminates in a lot of work going into how to map objects to DB's and vice versa. The differences between these paradigms can cause huge problems when you are implementing business logic in both tiers. Here is an example:
Let's say that you have a universal rule that states that you must have a full 9 digit zip code for all addresses. In the object world this type of rule implementation is simple - you simply enforce this rule on your Address object and use it everywhere you need an address. But in the DB world it is a common practice to embed this type of data within other tables. For instance, you have a customer table with address fields. Same thing for employees, vendors, etc.
Now in order to enforce that 9 digit rule you have to create a stored procedure (or a constraint, whatever) on each of the tables that contains address data. Add a new table with address data? Re-create the rule enforcement.
4) People - As you had mentioned (or maybe someone else did), most companies follow this formula; coders > DBA's. And they do it for good reason. By making the DBA the gate keeper for all of the rule logic you are increasing your "bus" risk factor (he gets hit by a bus, your company is screwed). Plus he is certainly increasing his own job security (I call this complexity based job security - the more complex I can make my work seem, the less likely anyone is to fire me). If I were to perform a risk assessment here I would definitely want my larger group of coders handling rule logic.
Hope this helps.
Jonathan House

Similar Messages

  • Displaying Value from Business Rule in the UI

    My requirement is as follows:
    I profile a customer based on some business rules and the business rules asserts a business object based on the rule evaluation. I checked the output of the Business Rule and I can see that the values have been set correctly but when I added the Business Object to the Human task the same is not displayed in UI. Can anyone please help me on this. I am using 11g.
    Regards
    Venkat

    If i'm not wrong, this is undoubtly teh MOST ASKED Qs on the Forum .
    U can get help from URL :- http://jsptags.com/tags/navigation/pager/
    Also, the Java Pet Store application has another such JSP tag library. Look in the package com.sun.j2ee.blueprints.petstore.taglib.list
    OR just simply search the Forums & u'll get many replies to ur Query

  • Can you deploy Oracle Business Rules to the other App servers

    Can you deploy Oracle Business Rules to the other App servers such as Websphere and Jboss

    Yes. Please see the Appendix C in the documentation at:
    http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28965.pdf
    For WebSphere, updated instructions will be released soon that allow all RuleAuthor features to be used.

  • Business Rule err The following value is not valid for the run time prompt.

    Hyperion Planning v 9.3.3
    I have created a new BR with 2 local variables (created at the time of the BR), Variables are set as run time prompts. They are created as "Member" (not Members). The BR basically does a calc dim on dense and Agg on Sparce other than the prompt on Entity and Version dimensions. The entity variable has a limit on level 0 of the dimension. The Version variable limits to the input (Submit and Sandboxes)
    The BR is associated in Planning with an input web form. Entity and Version are in the page. Is set to Run on Save and Use members on form.
    If the run time prompts Hide boxes are checked, an empty Prompt pops up with only a Submit button. Click the button and an error comes up: "The following value is not valid for the run time prompt it was entered for:. But it does not indicate what member - just ends in the :.
    The BR will run sucessfully only if the Run-time prompt is not hidden - "Hide" in the BR is unchecked. So the syntax and logic of the BR is correct and security should not be an issue.
    The client wants no prompt. In production we have similar situations in which the BR works with the Web Forms without a prompt.
    What am I doing wrong - I have tried restarting the Planning service and the EAS service.

    My preferred method of doing this is:
    1. In business rule, do not hide the run-time prompts. This makes it easy to validate the business rule as you are building it. I only use Global Variables.
    2. On the form, have business rule set to run on save, use members on data form and hide prompt.
    Check that in the business rule, for the variables (Run-Time prompts), that they are all in use. If not, delete them from the business rule. Are all your variables global? Are some local and some global? This could be the issue.
    Deanna

  • There is a grey blob growing on the corner of my ipod inside the screen. how do i fix it? help

    There is a grey blob growing on the corner of my ipod inside the screen. how do i fix it? help I have already replaced the screen once but it has stayed the same.

    Can you post a photo?
    Form yo description it seems like a problem with the display/screen
    What model iPod do you have?
    I ask because in the earlier one the top screen/digitizer is separate from the LCD display.
    Just what was replaced?

  • How to change business rule in the runtime

    I create a business rule and add it in a BPEL process. After deployment, this process works fine.
    How to modify the rule in run time? I mean I do not need to redeploy the process.

    If you are using SOA suite 10g qhen you add a decision serivce to your BPEL process it doens;t use a pointer to the rules repository but actually makes a copy of the rules respository and deploys it locally within the BPEL process. Because of this any changes you make to your initial respository will not be seen because the delopyed process does not use the original version. You need to update the decision.dec file in your BPEL project and change the repository information to point to the original rules repository you want to use.
    Once you have done this redeploy the BPEL process and your changes shoudl be reflected in your process.
    Hopefully this information helps
    Regards
    richard

  • Unable to find Business Rules in the JDeveloper while creating new project

    Hi All,
    I am going through the chapter 9 Creating a Rule-enabled Non-SOA Java EE Application for JDevloper 11g. I am following the instruction given in the chapter.
    However I am unable to find a Business Rules category for creating a Business rules directory.
    Probably it has to be activated from somewhere.
    I tried searching its significance with JDev installation but haven't got anything.
    It seems very basic level problem, however...Please let me know if anybody knows how to solve it
    Thanks,
    Makarand.
    Edited by: user11223806 on Aug 12, 2009 7:48 AM

    Did you install the SOA extension for JDeveloper from the help->check for updates?

  • Creating and using a calculated field in business rule from the currency conversion of another field.

    Hello,
    I'm creating a calculated field with a set currency for a business rule. I'm planning to use it as a deficiency criteria. I want the values to come from the currency conversion of another field. Can someone provide me the step by step procedure on how to do it?
    Some documents would be great.
    I've been trying to do it on my own but I've gotten lost.
    Thank you.

    Thank you for all your help above.
    Just to confirm your advice, am I right with the following conclusions? :
    1. The script (function) to fill the text field with the modification date of a different PDF file needs to be stored in a folder level .js file.
    2. The document containing the text field needs to call the .js function either within the document script or within the custom script property of the text field itself.
    Further to that can you just advise on the syntax for accessing the modification date of the other document.
    Do I need to assign a variable to the address of the file to be used, and then use this variable in the text form filling script (as below) or can I use a direct file reference at the .modDate command.
    var LastSync = "C:\sync\bin\lastsync.pdf";
    var strMsg = util.printd("h:MM tt",LastSync.modDate) + " on ";
    strMsg += util.printd("dddd, d mmmm, yyyy",LastSync.modDate);
    this.getField("LastSyncDate").value = strMsg;
    If the syntax is totally different to the above I would be very grateful for some guidance in the right direction.
    I much appreciate your time to help me ... I'm almost there.
    Kind Regards,
    Nifty

  • Solving "COMMIT business rules" on the database server

    Headstart Oracle Designer related white paper
    "CDM RuleFrame Overview: 6 Reasons to get Framed"
    (at //otn.oracle.com/products/headstart/content.html) says:
    "For a number of business rules it is not possible to implement these in the server
    using traditional check constraints and database triggers. Below you can find two examples:
    Example rule 1: An Order must have at least one Order Line ..."
    But, one method exists that allows solving "COMMIT rules" completely on the database level.
    That method consists of the possibility of delaying the checking of the declarative constraints (NOT NULL, Primary Key, Unique Key, Foreign Key, Check Constraints) until the commit
    (that method was introduced first in the version 8.0.).
    E.g. we add the field "num_emps" to the DEPT table, which always has the value of the number
    of the belonging EMP rows and add DEFERRED CK which uses the values from that field:
    ALTER TABLE dept ADD num_emps NUMBER DEFAULT 0 NOT NULL
    UPDATE dept
    SET num_emps = (SELECT COUNT (*) FROM emp WHERE emp.deptno = dept.deptno)
    DELETE dept WHERE num_emps = 0
    ALTER TABLE dept ADD CONSTRAINT dept_num_emps_ck CHECK (num_emps > 0) INITIALLY DEFERRED
    Triggers that insure the solving of the server side "COMMIT rules" are fairly simple.
    We need a packed variable that is set and reset in the EMP triggers and those value
    is read in the bur_dept trigger (of course, we could have place the variable in the package
    specification and change/read it directly, thus not needing the package body,
    but this is a "cleaner" way to do it):
    CREATE OR REPLACE PACKAGE pack IS
    PROCEDURE set_flag;
    PROCEDURE reset_flag;
    FUNCTION dml_from_emp RETURN BOOLEAN;
    END;
    CREATE OR REPLACE PACKAGE BODY pack IS
    m_dml_from_emp BOOLEAN := FALSE;
    PROCEDURE set_flag IS
    BEGIN
    m_dml_from_emp := TRUE;
    END;
    PROCEDURE reset_flag IS
    BEGIN
    m_dml_from_emp := FALSE;
    END;
    FUNCTION dml_from_emp RETURN BOOLEAN IS
    BEGIN
    RETURN m_dml_from_emp;
    END;
    END;
    CREATE OR REPLACE TRIGGER bir_dept
    BEFORE INSERT ON dept
    FOR EACH ROW
    BEGIN
    :NEW.num_emps := 0;
    END;
    CREATE OR REPLACE TRIGGER bur_dept
    BEFORE UPDATE ON dept
    FOR EACH ROW
    BEGIN
    IF :OLD.deptno <> :NEW.deptno THEN
    RAISE_APPLICATION_ERROR (-20001, 'Can''t change deptno in DEPT!');
    END IF;
    -- only EMP trigger can change "num_emps" column
    IF NOT pack.dml_from_emp THEN
    :NEW.num_emps := :OLD.num_emps;
    END IF;
    END;
    CREATE OR REPLACE TRIGGER air_emp
    AFTER INSERT ON emp
    FOR EACH ROW
    BEGIN
    pack.set_flag;
    UPDATE dept
    SET num_emps = num_emps + 1
    WHERE deptno = :NEW.deptno;
    pack.reset_flag;
    END;
    CREATE OR REPLACE TRIGGER aur_emp
    AFTER UPDATE ON emp
    FOR EACH ROW
    BEGIN
    IF NVL (:OLD.deptno, 0) <> NVL (:NEW.deptno, 0) THEN
    pack.set_flag;
    UPDATE dept
    SET num_emps = num_emps - 1
    WHERE deptno = :OLD.deptno;
    UPDATE dept
    SET num_emps = num_emps + 1
    WHERE deptno = :NEW.deptno;
    pack.reset_flag;
    END IF;
    END;
    CREATE OR REPLACE TRIGGER adr_emp
    AFTER DELETE ON emp
    FOR EACH ROW
    BEGIN
    pack.set_flag;
    UPDATE dept
    SET num_emps = num_emps - 1
    WHERE deptno = :OLD.deptno;
    pack.reset_flag;
    END;
    If we insert a new DEPT without the belonging EMP, or delete all EMPs belonging to a certain DEPT, or move all EMPs of a certain DEPT, when the COMMIT is issued we get the following error:
    ORA-02091: transaction rolled back
    ORA-02290: check constraint (SCOTT.DEPT_NUM_EMPS_CK) violated
    Disvantage is that one "auxiliary" column is (mostly) needed for each "COMMIT rule".
    If we'd like to add another "COMMIT rule" to the DEPT table, like:
    "SUM (sal) FROM emp WHERE deptno = p_deptno must be <= p_max_dept_sal"
    we would have to add another column, like "dept_sal".
    CDM RuleFrame advantage is that it does not force us to add "auxiliary" columns.
    We must emphasize that in real life we would not write PL/SQL code directly in the database triggers, but in packages, nor would we directly use RAISE_APPLICATION_ERROR.
    It is written this way in this sample only for the code clarity purpose.
    Regards
    Zlatko Sirotic

    Zlatko,
    You are right, your method is a way to implement "COMMIT rules" completely on the database level.
    As you said yourself, disadvantage is that you need an extra column for each such rule,
    while with CDM RuleFrame this is not necessary.
    A few remarks:
    - By adding an auxiliary column (like NUM_EMPS in the DEPT table) for each "COMMIT rule",
    you effectively change the type of the rule from Dynamic (depending on the type of operation)
    to a combination of Change Event (for updating NUM_EMPS) and Static (deferred check constraint on NUM_EMPS).
    - Deferred database constraints have the following disadvantages:
    When something goes wrong within the transaction, then the complete transaction is rolled back, not just the piece that went
    wrong. Therefore, it becomes more important to use appropriate commit units.
    There is no report of the exact row responsible for the violation nor are further violations either by other rows or of other
    constraints reported.
    If you use Oracle Forms as a front end application, the errors raised from deferred constraints are not handled very well.
    - CDM discourages the use of check constraints. One of the reasons is, that when all tuple rules are placed in the CAPI,
    any violations can be reported at the end of the transaction level together with all other rule violations.
    A violated check constraint would abort the transaction right away, without the possibility of reporting back other rule violations.
    So I think your tip is a good alternative if for some reason you cannot use CDM RuleFrame,
    but you'd miss out on all the other advantages of RuleFrame that are mentioned in the paper!
    kind regards, Sandra

  • Security group provisining only to show Business rules to the users.

    Hi,
    Could anybody tell what setting in the Group Provisioning required so that users in that group only see business rules in planning application and not calculation script on the servers. We work on 9.2 env. ?
    Thanks,

    Yes group is provisioned as planner and have essbase server access... and user in this groups are able to see both business rules and calc script in planning application... but we want to show them only business rules and not calc scripts...

  • Type of Business Rules inside HaleyAuthority

    At this moment I am working at my graduate rapport about the possibilities and limitations of Business Rules comparing with current configuration like workflow, scripting etc.
    I know there are a lot of different types of Business Rules (like Integrity rules, derivation rules, production rules and reaction rules). Maybe is my question silly, but which type of Rules are usable fore HaleyAuthority? I think it is possible to use more than one types, but is this true?
    Thanks a lot,
    Mark Suurland

    Anyone?
    Thanks you.

  • Oracle 11.1.1.2: Oracle Business Rules: Update Business Rules on the fly

    Hi,
    I understand that in the latest Soa release (11.1.1.2), the rules, previously built on Jdeveloper can be changed from the em console.
    I have installed everything, but cant find my way to any such facility. Kindly provide advice.
    Regards,
    Anand.

    Hi Anand,
    This facility is provided by SOA Composer not through EM.
    Try accessing http://host:soa_server_port/soa/composer/
    You will be able to define/edit rules on the fly using this SOA Composer

  • Invisible watermark - to be built INSIDE the images, how?

    Lightroom friends and all others,
    I use Adobe Lightroom 2.3, Adobe Design Premium CS4 operating with latest Macintosh system architecture version, OSX 10.5.6, using MBP 17" laptop and MacPro.
    I tried to Google on the topic, but most seems to show invisible watermark softwares for Windows-based platform. I have also went into three or four links, but came out for Windows even Google failed to reflect the search query result I asked for MAC. (sighs)
    I would appreciate some heads up, techniques and if any standalone application or plug-in I can purchase, let me know with link etc.
    Thanks. Brian

    Just slightly off topic...just curious as I don't intend to use Digimarc but...Is the Digimarc filter supposed to be in the 64bit version of PS CS4? I don't see it there but I do see it in the 32 bit version. That's on both my desktop and laptop with Design Premium installed.

  • Customer orders arriving into the past - How to avoid?

    Hello Experts,
    I would like to ask regarding the scheduling agreements which are affect the production planning.
    So the problem:
    I have some customers who sometimes sending their orders so that the delivery date is already in the past when the IDOC arrives (e.g. today is 13/04/2014 and the delivery date of IDOC is 02/02/2014... it is very annoying and to top it all completely impossible to deliver on time), due to this incidents the backlog management is not so easy.
    Is there any kind of option to change somehow the scheduling agreements so that if the delivery date of IDOC (when it is arriving) is earlier the than "Today" then the system overwrite it and the new delivery date will be "Today + Delivery duration"?
    The time fence setting in MM is not allowed option.
    Thanks in advance the response!

    Péter,
    Before you change anything in your system, don't you think it would be smart to first talk to the customer(s); to find out:
    1.  Why he is sending past due dates
    2.  What is his expectation for your company concerning these dates?
    2.  What impact do these dates have on any contracts there may be between you and him?
    You customer may have a purpose for sending such dates.  It doesn't make sense to change these dates just because you think they are 'annoying'.  In particular using the formula 'today plus delivery duration' could be dangerous, if the customer believes that the contractual commitment is that your company will deliver the products 'today'.
    These dates represent 'requirements'.  A planner cannot assume that all requirements dates will always be reasonable.  His purpose is only to create the best supply plan possible to meet the requirements, even when the requirements are unrealistic.
    Best Regards,
    DB49

  • Is Business Rules = ILOG JRules?

    Sorry for the newbie question:
    Is Oracles Business Rules package the same as ILOG JRules?
    If not: What are the differences?
    Where can I download Oracle Business Rules?
    If it is included in SOA Suite: Where exactly can I find Business Rules inside the SOA Suite installation resp. How can I call BR?
    Peter

    The oracle business rules engie is derived from Sandia Lab's Jess Rules engine.
    Although the Rules language of Oracle Business Rules is called RL. RL looks very similar to Java and replaces the original Jess language, which looks similar to LISP and has been eliminated from Oracle Business Rules.

Maybe you are looking for

  • How do I get the download window in iTunes 11?

    Hi there, Back in the iTunes 10 days (ie last week) there was an option for a download windowin the sidebar that popped up when you were downloading things - eg podcasts from the iTunes Store. If you clicked on it you got a new window showing what yo

  • HT4796 What happens with my old user account on my MacBook?

    Once this process is done, is there a way to delete my first user account on my Mac? I mean, this is saying that everything will transfer to a new account; it won't merge with your current account on the Mac. I only want ONE user account on my MacBoo

  • Crystral reports - including paramater values on report

    Hi, I have a parameter which can have multiple values and which is used in the selection formula.  I would like to display all the values of the parameter in the report header but only the first one input shows.  I have tried enlarging the display bo

  • CS3 & Snow Leopard Crash

    Hi - We have a client that experiencing issues with CS3 crashing on their Mac Pro running Snow Leopard (Mac OS X 10.6.7). Actions already taken in troubleshooting Uninstall & Install CS3 Snow Leopard Clean Install Apple Hardware Tests come back clean

  • X201 w/ Centrino Ultimate-N 6300 Stops Working at Random

    About once a day, the wireless on my X201 stops working all of a sudden. I have tried updating the software, BIOS, etc, but still it continues. I have Win 7 Professional 64. Does anyone know how to solve this?