LLBL Validation

Posts   
 
    
thisbox71
User
Posts: 4
Joined: 12-Oct-2006
# Posted on: 04-Jan-2007 23:25:13   

I am running LLBL 2.0.0.0 in a .Net 2.0 env.

We are currently working on validation code for the LLBL classes in manager classes and I discovered that LLBL supports validation via Custom code.

I am trying to decide if we should use LLBL or our own validation routines. I am partial to using the LLBL validation (because, well, it's there!) and I am catching a bit of resistance to this. Can anyone give me good reasons to use the LLBL validation vs writing my own outside of the generated classes?

Thanks,

Rob

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 05-Jan-2007 06:27:32   

You have to things 2 validate, Entities and Fields.

You have 2 ways to place your validation, in separate classes or in the generated entity classes (whether in the same generated files or by using partial classes).

At the end of the day, both ways works exactly the same way. So what is the difference? The difference is how you like to organize your code (you can think of code maintainability here)

So was your question about using either of these 2 ways, or using one of them comparedd to writing your own BL validation?

thisbox71
User
Posts: 4
Joined: 12-Oct-2006
# Posted on: 05-Jan-2007 06:41:56   

My question is: Are there any arguments that would indicate that it would be wiser to use one over the other?

Thanks for the response.

Rob

Walaa wrote:

You have to things 2 validate, Entities and Fields.

You have 2 ways to place your validation, in separate classes or in the generated entity classes (whether in the same generated files or by using partial classes).

At the end of the day, both ways works exactly the same way. So what is the difference? The difference is how you like to organize your code (you can think of code maintainability here)

So was your question about using either of these 2 ways, or using one of them comparedd to writing your own BL validation?

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 05-Jan-2007 07:08:01   

None (as far as I know).

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 05-Jan-2007 10:07:02   

Functionality wise: none. Though it's a matter of how you want to work with things: do you like to have everything related to a 'Customer' class INSIDE the customer class, or do you find it more practical to create separate classes for doing small things in conjunction with a given class (so you can switch them for example).

Frans Bouma | Lead developer LLBLGen Pro
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 05-Jan-2007 15:10:45   

personall,y I like having the validation in it's own class and override the CreateValidator() within the entity. The main reason is readability and seperation of function.

As for writing your own validation classes that validate entities outside of llbl. I wouldn't recommend this. It seems your making more work for yourself/team. the validator classes within llbl are very easy to work with.