I have been using CSLA for 4 years. (For an ASP.Net app.) It has been fantastic. It is an excellent framework.
There are lots of details to learn - but once you are up to speed it is very straightforward to build CSLA business objects. I use Codesmith templates to build them. I can get thousands of lines of code generated in just a few minutes and it all works perfectly and compiles right away. I can't imagine building BOs by hand - the number of bugs would be huge.
The best idea we had was to create Use Case Controller objects which are simply Root objects that contain all the BOs needed for a particular use case. I originally called them a Unit Of Work so I suffix them with UOW (but apparently that is not a good term to use for these kinds of BOs - Use Case Controller is better.)
Being a Root object the UOW has its own rules and can tell if any contained objects are dirty or valid. This lets me call Save on the UOW and all the contained BOs get updated correctly. I can also display all the Broken Rules for the UOW and its contained BOs.
Rocky has been continually improving CSLA and the community is very strong. No negative experiences. It is that good. Highly recommended.
Joe
I have avoided Stored Procedures because I need to support both SQL Server and Oracle. I have a set of classes where I define the SQL statements. Then I use a DAL that I wrote which is very similar to the MS DAAB. This allows me to encapsulate all the ADO.Net commands into one namespace.
So my DataPortal_xxx methods have code like:
dr =
New SafeDataReader(DAL.ExecuteReader(cn, CommandType.Text, SomeDAO.SelectByUserkey(mUserkey)))The class SomeDAO above returns the SQL string with the passed in userkey as the parameter.
DAL.ExecuteReader is one of the dozen overloaded methods that allow me to execute the datareader without writing all the ADO.Net code more than once.
Other people have used OR mappers like NHibernate. So you can see that the DataPortal is a very flexible concept.
Joe
Copyright (c) Marimer LLC