Validation vs. Business Logic
In the manuscript I'm reading, I just ran into a diagram and overview of a layered architecture - and all of a sudden, it hit me. At work, most of our business rules are being implemented by Struts' Validator framework. In the case of indexed properties and more complicated rules, these reside in the validate()
method of our action forms. So it's interesting to me that I'm using a business delegate to perform my business logic - when in actuality, all my delegates are doing is copying properties from a POJO to an ValidatorForm. So this begs the question - shouldn't validation (a.k.a business rules) be done wherever it is most convenient rather than only in the domain layer? Oh yeah, and most of this is just validation - our real business rules (comparing data for validation) takes place in Oracle stored procedures. And you know what - it works great!. So my opinion is - do whatever is easiest and makes the most sense.
Posted by matt on April 29, 2003 at 02:20 PM MDT #
Posted by Jason on April 29, 2003 at 02:29 PM MDT #
Posted by Dave on April 29, 2003 at 02:48 PM MDT #
Posted by Colin Evans on April 29, 2003 at 09:04 PM MDT #
Posted by Dhananjay Nene on May 01, 2003 at 09:01 AM MDT #
Posted by Dhananjay Nene on May 01, 2003 at 11:38 AM MDT #