Anyone have any experience using CSLA.Net ? I’ve seen it being used in the past but more as a Data Access Layer, which is not exactly what it was designed for.
I’m working on a project that would basically envolve creating a bunch of “Business Objects” that do all the heavy lifting that can easily be bound to an user interface. These business objects are not going to be using SQL based data though but rather be talking to an ERP system via a COM/Webservice interface in an xml format.
I want something that allows me to creat an object that I can then define how it should be loaded, saved etc. I would also ideally like to be able to put in validation rules on the properties of the object.
If you have any ideas of frameworks other than CSLA let me know too. Ideally it must support WPF and if at all possible Silverlight.
(Too be honest, my exposure to CSLA has only been what I’ve read online and talking to other people who have used it so take all of this with a grain of salt)
The fundamental thing that I disagree with is that it makes your domain objects quite heavy weight. I’m of the opinion that your domain objects should not know how to save themselves to the DB or write a report. That should be the job of other specific objects designed for the task. Separation of concerns is a big thing for me as it makes objects easier to understand and use.
My personal methodology of choice is TDD and when you have too many dependencies in a class it can make it difficult to test. I’d rather have many small classes then a few huge ones. With TDD, it doesn’t matter if you start off on the wrong path in your design because you have the unit tests to back up any changes that you make. It just takes discipline.
Personally, the “methodology” I use these days is a combination of TDD and the SOLID principles (though I’ve found TDD leads to the SOLID principles). Rhinomocks (for mock objects), NUnit (there may be better ones), Spring (for IOC/AOP), EnterpriseLibrary (for validation) are a few of the libraries I would recommend.
Having said all of that, there are some people who do sing CSLA’s praises so it must work for them. It does seem to give you a lot of functionality out of the box so it might get the project done quicker. It’s just not the way I would do things.
Oh, and of course, NHibernate 😛
@Richard, Thanks… you seem to have managed to distill much of what I’ve read about CSLA into one comment.
Of course NHibernate is more of an ORM tool… where as, from what I’ve read CSLA is more a “Business Object” framework… in fact you can layer the two on top of each other… in that the objects are read/saved via NHibernate but still CSLA objects so you can easily data bind them and move them about along with a host of other nice features.
The big downside to CSLA is although the code is freely available you have to buy the book to make any sense of it or read alot of code.
NHibernate is indeed an ORM tool. I just forgot it out of my preferred frameworks :P.
Hi Dale, Richard
We currently use CSLA on about 10 projects. We have acquired a lot of experience in it over the years. The objects are quite big but the power and low maintenace outway any negatives. I would say I would not recommend it for highend web sites with thousands of users. It is fantastic for small to medium size projects.
One of the developers at Singular has written a very powerful CSLA pluggin that will generate the objects for you. If you are interested he could probably help you out.
Cheers
Bruce