How to design a framework for implementing rules in JSF/Spring Application

We use JSF 1.2 (MyFaces 1.2.2) in the presentation layer, Spring 2.5.3 in the service layer and Hibernate3.2 as persistence layer.
The java application we are building is mostly CRUD but involves tons of business rules which needs to be implemented at both presentation and service layers
We are planning to design a business rule framework so that developers can work on individual business rules without stepping on each other and also to prevent redundant implementation of the same business rules .
Here are the Goals
Solution Goals:
• Business rules are implemented in only one piece of code. i.e. Rule is packaged into a unit
• Business rules have an consistent, identifiable form.
• Rules have to be Abstract
• View technology like JSF says I want to createManufacturer(Manufacturer manuf) passing Manufacturer object as parameter. Then the business rule framework should go and fetch the rules to do the job of createManufacturer () and then return the result.
• Fetch the Rule based on
�X Target object
Is the concrete object on which you are performing the Rule for example Device object
�X Operation Type
Is C R U D Validate
Proposed Solution:
• To have catalog of business rules which will have name of the rulewith parameters and dependencies
• To have Rule Context designed in such a way that it goes and fetches the Rule i.e. give me all the Rules from the RuleContext and the client will decide which Rule to Apply.
We modeled the business rule framework as a variant of Strategy pattern. But this approach has limitation in the sense it requires Rules to be injected into the Service Layer Spring Beans .
Then we looked at other design patterns like Command, Visitor but that doesn’t seems to fit the bill either.
Any pointers/suggestions will be greatly appreciated

"In many cases multiple instances of a single class works just as well."
This sounds a lot like the way I would do something in other languages. I would simply create an array of structs (or records) containing variables like these:
type critter:record
  int x,y; // The critter's position, of course
  int vx,vy; // Used to keep track of velocity
  int ctype; // What kind of thing this is
  int subtype; // Additional flags or info that may affect behavior
  int yadayadayada,etcetera;
end;
var critters:array[0..somelargenumber] of critter;Of course, I suspect that what may work well in Pascal might not work as well in Java. For one thing, I don't think Java even has records per se. It may be necessary to use a class to duplicate that functionality. (Is this true? Or did I miss something?) The array then becomes an array of objects.
Since I'm using classes anyway, I guess it makes sense that I should go all the way, creating interfaces for common functions and subclassing a basic Critter class for each different kind of critter (at least in cases where the behavior and/or rendering methods would be significantly different from the basic class methods).
This is okay as long as I don't go overboard, right?

Similar Messages

  • How to design  class(es) for implementing game characters?

    Good day! i have a player, monster1, monster2, vendor etc. in my game. what is the best way to design classes for my creatures? by the way, im using midp (J2ME). for now, i have a Creature superclass for my characters. Player, Monster, NPC are its subclasses. have i done the right thing?
    What about class design for my monsters? will i make Monster class a superclass for Monster1, Monster2, Monster3 etc?
    im just concerned of my code's efficiency and speed. i wonder if too much classes could slow down my application since i'm developing a mobile game..?
    regards.

    "In many cases multiple instances of a single class works just as well."
    This sounds a lot like the way I would do something in other languages. I would simply create an array of structs (or records) containing variables like these:
    type critter:record
      int x,y; // The critter's position, of course
      int vx,vy; // Used to keep track of velocity
      int ctype; // What kind of thing this is
      int subtype; // Additional flags or info that may affect behavior
      int yadayadayada,etcetera;
    end;
    var critters:array[0..somelargenumber] of critter;Of course, I suspect that what may work well in Pascal might not work as well in Java. For one thing, I don't think Java even has records per se. It may be necessary to use a class to duplicate that functionality. (Is this true? Or did I miss something?) The array then becomes an array of objects.
    Since I'm using classes anyway, I guess it makes sense that I should go all the way, creating interfaces for common functions and subclassing a basic Critter class for each different kind of critter (at least in cases where the behavior and/or rendering methods would be significantly different from the basic class methods).
    This is okay as long as I don't go overboard, right?

  • How to design a system for a bank?

    The company I work for is about to design a system for a bank. This system will be used by office clerks to help their daily works. For example they can handle bank accounts, credit cards, credit products, loans, client data, stuffs like this. It's a kind of accountant system.
    As I don't want to reinvent the wheel I'm sure there are several solutions for this problem. Patterns, case studies, books, real life stories. I'm looking for them.
    Would you be so kind to recommend something I can use?

    I don't know how big a company you're talking about.
    I'd look into ERP systems like SAP,
    Oracle/PeopleSoft, Great Plains, etc.The task is to implement a system with which we can help the for of the office clerks. So we don't have to implement a whole accountancy system from the beginning to the end we just have to implement some kind of frontend and services for the frontend. These services will be used by the frontend and will be connected to the accountancy system of the company ( legacy app written in Cobol ).
    So I need some books, strategies, etc on how to implement, architect a tipical banking app. E.g. What does account (, banking products, loans ) really mean? What kind of tipical patterns should I use?
    I've browsed the web, of course, and I have found "Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions" for example but I'm not sure this is the thing I need. I've found Martin Fowler: Analysis patterns ( closer to what I need, so I've bought it already ). For example that one has a lots of patterns I should use ( Account, Transaction, Accounting Practice ).
    So I'm looking for something similar to the book "Analysis patterns" but with more with strategies and practical information on design and architectures as well.

  • How to Design a Page for Both Insertion and Updation

    Hi,
    I have Page where I need to populate a table from Standard PO/AP table and once the save is clicked on the table,
    the data shoudl be inserted in custoim table.
    Ex: Ui table wil have 3 columns and say 5 rows
    - PO#
    - Line#
    - Amount for 'X' purpose
    where PO# and Invoice# is populated and Amount is empty
    User will enter value in Amount column in all 5 rows and click on Save button.
    Now these 5 rows with 3 columns should be inserted into the custom table (PO#, Line# and Amount)
    How Can I design Model Objects for such a requirement?
    Thanks,
    Kamath

    You should create an EO on your custom table and a VO on your EO. As you insert records in the VO, corresponding rows are created as EO rows and when you commit (getOADBTransaction().commit()) in the AM everything would get committed to the DB.
    As far as subject goes of having a common page, everytime you can execute the VO with the bind parameters and check whether a row exists. If it does exist then update the VO Row (I expect the master record to be unique row). Otherwise create a new Row for the master and then correspondingly for the details row.
    Do let me know in case you need additional information.
    Regards
    Sumit

  • How to design Flat file for loading attribute dimension in a planning application

    Dear Gurus,
    I have a requirement to extract attribute dimensions from an essbase application and load it to another planning application. I have a dimension called Program and two attribute dimensions Sales Manager, Accounts manager associated with Program dimension in Essbase application. I will Extract these dimensions using Essbase outline extractor. After Extracting the attribute dimensions I have to load these dimensions to planning applications using outline load utility. Kindly guide me how to design the flat file for loading attribute dimensions in planning application.
    Thanks and Regards
    SC

    You could dig through the docs and try to figure out the file format manually, or you could do this the easy way.  Simply use the Outline Load Utility to export your attribute dimension from Planning.  The export file format is the same as the import file format.  You might have to manually add a couple of test members to your attribute dimension so that your export file has some content.  Then simply update the file you exported, and import it.
    (I am assuming you have already manually created the Attribute dimension in Planning, and that you simply need to add members to it.)
    Hope this helps,
    - Jake

  • STRESS AND LOAD TOOLS FOR JSF & SPRING APPLICATIONS

    Hi,
    I am looking for tools
    I have a web application based on JSF and Spring framework.
    � want to test performans(load and stress) of my application.
    Which tools are available ?
    thanks.

    Try JMeter and Selen.

  • Need guide on how to design LabVIEW layout for displaying an output from Kelly Controller to control the CompactRio

    Hi guys. Do need some help here.
    My task is to design a LabVIEW design shematic to display the regeneration current drawn from the BLDC motor through Kelly Controller with an output voltage range of 0-5V. The Kelly Controller is to communicate with the CompactRio. However, I do not know how to start it and I'm kinda new to LabVIEW.
    Really appreciate any kind help and guide that can progress me ahead. Thanks.

    Hi kienyang90,
    CompactRio guide can be found in NI website via this link http://www.ni.com/pdf/products/us/fullcriodevguide.pdf 
    By reading the guide, you will get an idea on how it works.
    To connect compactRio with external module or sensor, you need an i/o module.
    for example an analog input module is this one http://sine.ni.com/nips/cds/view/p/lang/en/nid/208798
    You have to pick modules depend on what kind of output source you are going to give to the compactRio
    Hope this help
    TuiTui

  • How to design block diagram for axi tpg and axi vdma on zedboard using vivado 2014.4 and sdk c application

    Hi,
    I am working in image processing project ,but currently i want to use tpg ip and vdma ip to write frame data in ddr3 on zedboard,please provide me vivado block design and sdk c application for that
     

    Please don't post the same thing multiple times. This one is fine:
    http://forums.xilinx.com/t5/New-Users-Forum/how-use-axi-tpg-and-axi-vdma/m-p/638588

  • How to design interactive pdf. for multiple additions and saves???

    Using LiveCycle designer -  Can anyone clarify how we can let others make multiple additions and saves to an interactive pdf. I created in Live Cycle Designer 8.2.1...
    I have created an interactive pdf. with LiveCycle designer and sent to client.
    Is there any way I can give them ability to save the pdf. make  multiple additions and saves and send back when they have completed it?
    or even pull up the file make changes and resend at some point in the future without having to fill in all form field again?
    Thxz much,
    JR

    Sorry but this is the wrong forum (this is for the Collaboration Services). You may want to try the LiveCycle Designer forum:
    http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_designer_es

  • How to design a table for Billing purpose

    hi all
    I want to develop a software for Billing purpose
    A company wants to record all sales in computer and at the month end wants to print out billing for all clients I have design this in foxpro and in Foxpro we did that when new month will start then new table generate like Crd_0707 (Credit month year).
    now I want to develop in oracle how I should start this project I mean who can I design tables.
    thanks

    If you understand relational theory and design shik Date's books. What you need to understand before porting an application from another database to Oracle is how Oracle works.
    If you do not know relational design then you need to learn it long before you start any porting project.
    If you know relational design then read the Application Developers Guide - Fundamentals, plus the first few chapters of the SQL manual up until the syntax diagrams start. These chapters identify the single row and aggregate functions that Oracle provides and introduce optimizer hints for tuning while the later chapters provide the syntax for DDL: create table, create view, etc .... You will also want to read the PL/SQL Users Guide and Reference then look at the supplied PL/SQL Packages and Types manual.
    After reading all this you meet the minimum requirements to work with Oracle, and I really do mean minimum.
    HTH -- Mark D Powell --

  • How to design to perform for a network mediation correlation application?

    we have three network devices, each producing text based logs for their own activity. each node can start a traffic and each node can be an end. but a traffic here can mean going back and forward on nodes. and we are intrested to report the each traffics start end nodes, like a CDR we may say.
    I have imported the data of each node to a table, but this is not mandatory, in order to have the required output I can easily denormalize the target tables, similar to a ETL of a DW.
    If I have the data in three seperate tables I suppose I will need to implement a recursive pl/sql function, since the data is ~250 million rows per day to have a performant process to find the start and end points of each traffic what kind of a table design and as a result SQL or PL/SQL algoritm do you advise?
    any example code you may be aware of pipelined pl/sql feature used recursively?
    thank you.
    ps: for the current test environment we have 10.2 installed on solaris but we can easily decide to use 11.1 if there is any special motivation for this need.

    You could dig through the docs and try to figure out the file format manually, or you could do this the easy way.  Simply use the Outline Load Utility to export your attribute dimension from Planning.  The export file format is the same as the import file format.  You might have to manually add a couple of test members to your attribute dimension so that your export file has some content.  Then simply update the file you exported, and import it.
    (I am assuming you have already manually created the Attribute dimension in Planning, and that you simply need to add members to it.)
    Hope this helps,
    - Jake

  • How to design these containers for info and graphics?

    I am not even sure what this is called, it is a combination of CSS and html, a simple container for information and graphics like seen on this page:
    http://www.adobe.com/cfusion/labs/search.cfm?loc=en_us&term=spry&search=
    with the header "Search Adobe.com"
    1. Is there a way to easily design one of these in DW without knowing code?
    2. Is there an extension to do this?
    Thanks!!!

    See here http://www.extendstudio.com/product/flexipanels_css.html

  • How to design a database for multi Companies

    I like to hear your comments if you have a database that serves multi companies or if you have good knowledge about this subject.
    Our data is sensitive and I was thinking on creating a schema for each company but seems that's a lots of work specially when the schema will change.
    Do you keep your multi companies data in one schema, if so, what kind of care we need to take to avoid any mishap??
    Thanks
    Mo

    user4018813 wrote:
    I'm just getting started attempting to implement Label Security to move our product from a single to a multi-tenant (i.e. customer) architecture. What is the best way to debug Label Security problems? I've tried trace levels 10730 and 10060 using commands like this:
    ALTER SESSION SET EVENTS '10730 trace name context forever';
    but didn't get a trace file.
    I did get a trace file for a 10046 trace. Here's a SQL statement that resulted from that trace:
    SELECT "C1","MI_ROWLABEL_3" FROM "MT_DB1"."T3" "T3" WHERE (1=2 )
    I didn't specify that 1=2 predicate, so where is that coming from?
    Any help would be greatly appreciated.try instead
    Event 10730 - Trace Fine Grained Access Predicates
    This event traces find grained access (RLS) predicates
        ALTER SESSION SET EVENTS
        '10730 trace name context forever, level 1';

  • How to design DAQ software for DYNON's ELAB-080 DAQ module in Labview?

    We are using DYNON's ELAB-080 DAQ module. How to develope the DAQ software for the same using your Labview7.0.?

    Dear Ajay,
    National Instruments doesn't have any drivers for devices that they don't make. The best solution is to get a National Instruments board. However, if that's not an option, a lot of companies have drivers for LabVIEW that they created. Contact DYNON to see if a driver for your module exists. If there isn't a driver, you can always use LabVIEW (Call Library Function Node.vi) to make calls to the driver DLL. Have a great day!
    Sincerely,
    Marni S.

  • How to design a script for cheque payment for F-58

    Hi
       I am trying to modify the existing form F110_prenum_chck.i copied it to my zf110_chck...but i am not able change the text elements inside that,not even able to delete the existing windows.
      it is not coming to change mode...
    pls help me how to solve this issue...
    Regards
    amayika

    Hi
    GO to se71
    1.Open  your form.
    2.Go to form options.
    3.Copy from .
    4.Enter the name fo ur zform & select language.
    Rina Patil.

Maybe you are looking for

  • [BUG in coreutils-8.15] - Wierd 'du' behavior on my server ...

    Suddenly, today I needed to know what's the size of the backup tars from my linux-vserver based vps running fully up-to-date arch linux and I can't seem to find out why 'du' is acting like this. ┌─[23:39:09]-[root@stavrovski]-[~] └─› du -csxh /tmp/*

  • Can I install windows 8 on my iMac so all drivers work?

    Puedo instalar windows 8 en mi imac para que funcionen todos los drivers? whit botcamp

  • Windows xp trade in issues

    I brought in a laptop with a working battery, no screen crack, and a valid serial number. According to multiple replies on these forums, this laptop should qualify for the trade in program. However, I was denied the trade in because the screen was pa

  • How to compare two portal server settings

    Hi, How to compare two portal server configuration settings? For example I want to compare sandbox with development portal server their entire configuration set up and settings details comparision. Is there any option/solution for this.

  • ReadOnly files in iFS

    Hi Folks, I just installed and using iFS 9.0.2.1.0 on Windows platform. users experience their files read-only sometimes and could not work with their files. they use mapped-drive into iFS as their storage device. iFS installed on Oracle 9i Relase 2