Generic Bean: simple validation

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.

Lascia un Commento

Fill in your details below or click an icon to log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Follow

Get every new post delivered to your Inbox.