|
From: Andy D. <an...@ma...> - 2004-06-11 17:16:08
|
I've run across a rules package in the Spring sandbox (org.springframework.rules) while working with spring-rcp (spring-rcp uses it for input validation), and was wondering if any thought has been given to integrating it with JSR-94? It is often unfeasable to keep some business logic isolated in a single tier (for example, some business logic ends up being in the UI for validation, some in the service layer, etc). However, it may be possible to avoid duplicating business logic and at least manage it from a central location. I've found that sometimes validation rules are duplicated elsewhere in the system (behind the service facade or in the DB, for example). What if I could keep rules in a central location (a rules DB or a set of XML files on the server), and then serve those rules to whoever needs them? For example, the UI asks for any rules against a particular object that it is editing so it can perform as-you-type validation, while the domain model behind the service facade might ask for the same rules to both validate and operate on data passed in from a client. This way, all my rules are centrally managed, never duplicated, and can be reused. I'm thinking of using such an approach in my next project and basing it off of JSR-94 - but I'd like to use spring and spring-rcp and since spring-rcp relies on org.springframework.rules, it would be nice if the rules package could integrate with JSR-94. I'm just brainstorming at the moment, so I could have missed something... Is this a bad idea? - Andy |