In my previous post i write about a generic base bean to be extended in concrete classes. In a recent application i needed some simple validation rules to mantain the object in a consistent state, so i decided to add a couple of custom attributes to properties:
- min: min lenght for string or min value for numeric;
- max: max lenght for string or max value for numeric
I also added a generic validation method to the base class.
New code and sample can be downloaded from here.
Pubblicato da Salvatore Fusto
When writing a CFC that models an object of a domain, you can have a bunch of properties and then a bunch of setter’s and getter’s methods, a couple for each property. Basically each setter sets a property with a value passed as argument, and each getter retrivies the value of a property .