Alex Rivera | Logout

Does anyone have any real-world experience of CSLA?

Asked 2008-08-18T21:23:50.877
51

The main web application of my company is crying out for a nifty set of libraries to make it in some way maintainable and scalable, and one of my colleagues has suggested CSLA. So I've bought the book but as :

programmers don't read books anymore

I wanted to gauge the SOFlow community's opinion of it.

So here are my questions:

  1. How may people are using CSLA?
  2. What are the pros and cons?
  3. Does CSLA really not fit in with TDD?
  4. What are my alternatives?
  5. If you have stopped using it or decided against why?
Edit
Report

3 Answers

6

Not to take CSLA of the list, but before using it, research the benefits and make sure they really apply. Will your team be able to correctly/consistently implement it? Remoting and portal dance needed?

I think beyond all the theoretical ponder, it is all about clean/maintainable/extendable/testable code following basic proven patterns.

I counted lines of code needed in a specific domain of a project converted from CSLA. Between all the different CSLA objects(readonly+editable+root+list combinations) and their stored procs it took about 1700 lines, versus a Linq2SQL + Repository implementation that took 180 lines. The Linq2SQL version consisted mostly of generated classes that your team doesn’t need to consume book to understand. And yes, I used CodeSmith to generate the CSLA parts, but I now believe in DRY code with single responsibility bits, and the CSLA implementation now looks to me like yesterday’s hero.

As an alternative I would like to suggest looking into Linq2Sql/Entity Framework/NHibernate combined with Repository and UnitOfWork patterns. Have a look at http://www.codeplex.com/backgroundmotion

Cheers!

answered 2009-04-06T07:01:39.913
5

We use CSLA extensively. There are several benefits; first, I believe that every line of business developer should read Rocky Lhotka's book on Business Objects programming. I've personally found it to be in my top 3 best programming books ever. CSLA is a framework based on this book and using it gives your project access to very high level functionality like n-level undo, validation rules and scalability architecture while providing the details for you. Notice I said "providing" and not "hiding". I've found that the best part of CSLA is that is makes you understand how all of these things are implemented down to the source code without making you reproduce them yourself. You can choose to use as many or few features as you need but I've found that by staying true to the design patterns of the framework, it really keeps you out of trouble. --Byron

answered 2009-01-28T13:33:45.093
3

I am using CSLA as the business object framework for a medium size project. The framework has come a long way from the VB6 days and offers an extraordinary amount of flexibility and "out of the box" functionality. CSLA's mobile smart objects makes UI development much easier. However, I agree with others it isn't the right tool for every situation. There is definitely some overhead involved, but also a lot of power. Personally, I am looking forward to using the CSLA Light with Silverlight.

Pros:

  • Data technology agnostic1
  • Large install base and it's FREE!!
  • Stable and Logical framework
  • Data Access code can be in your objects or in a separate assembly
  • Property and Object Validation and Authorization

Cons

  • The code can be a lot to maintain2
  • Probably need a code generator to use effectively
  • Learning curve. The structure of CSLA objects are easy to grasp, but the caveats can create headaches.


I'm not sure about test driven design. I don't unit test or test driven design (shame on me), so I don't know if unit tests are different than TDD, but I know that the most recent version of the framework comes with unit tests.


1 Good thing because data access technologies never stay the same for long.
2 This has gotten better with recent versions of the framework.

answered 2009-06-08T04:54:53.320

Your Answer