views:

86

answers:

2

Hi,

I am looking at the Lhotka CSLA.NET object library (Lhotka.NET). It seems interesting, but one thing which does not make sense is that the business rules are written in C#. Should these not be coded outside of code (even though it would be a library which is not coupled to the main logic of an app the rules can still change and require recompiling).

Thanks

+3  A: 

No, that would be the inner platform anti-pattern.

If you make a system that is advanced enough to handle any business rule that you might possibly need, it will be much more complicated than it has to be.

Guffa
+1  A: 

CSLA business rules are just delegates that return true if the rule passes and false if it does not.

Since the business rules are just code, you are free to do whatever you like. You can create a rules engine if you wish and process the rules outside the objects if you wish.

CSLA also supports attribute based DataAnnotations if you wish to use attribute based rules as well.

Jamie Wright