views:

1003

answers:

5

We are about to commit to implementing Rocky Lhotka's CSLA as an application development Framework for our Visual Studio 2008 solutions. I would like to test the water on SO and am particularly interested in developer's opinions of the approach in comparison with other ORMs such as Entity Framework or nHibernate.

Also, what is the learning curve like and is it as easy (as I have heard) to maintain the applications written to this methodology?

Also would be very interested to hear from any Public Sector (especially Government Agencies) who have implemented this.

Thanks,

MaS

+2  A: 

I love CSLA.

I used it to implement some ASP.NET 2.0 applications, some very large. It's easy to understand (after you understand Root, Child and Switchable objects), but you'll rely heavily on code generation (like CodeSmith).

Main question is: do you need CSLA? What feature do you like, or you just need to use some ORM? Today, I'm writing new applications with ADO.NET Entity Framework and it's more productive than CSLA.

Keep in mind CSLA isn't a metodology, but just a tool: you'll need to understand it and to tweak it when appropriate.

Rubens Farias
Thanks Rubens, have you used CSLA with TFS at all?
MaSuGaNa
that time was vss...
Rubens Farias
+1  A: 

You can check Rocky's thoughts on SOA in the following broadcast:

http://www.slickthought.net/post/Minneapolis-Developer-Roundtable-Podcast---Talking-REST.aspx

The main thing you will need to grasp is that CSLA is a Business framework. Even though ORMs can give you basic validation (and other) features they do not IMHO really compensate for the lack of a solid business layer. You can of course use an ORM with CSLA (there is an example of using EF in the CSLA examples and NHibernate is used as an example in the CSLA Contrib project I believe) but the technologies are just complimentary.

The learning curve... well that depends on you. I found it quite easy to get started with. i think if you have a good grasp of OO you should be fine to get something basic up and running soon. The recent videos released are also very good to get yuo started.

Andreas
+4  A: 

CSLA is not an ORM framework. It is a framework for implementing business objects. However, there are code generators available which can generate data access code for you. The CSLA framework is based on Active Record Pattern. This pattern will not scale for large scale project. In my opinion, you should implement a prototype. The goal of the prototype should be to:

  1. Define a layering Scheme
  2. Unit Testability of Classes
  3. How the framework plays well with other framework
  4. How it fits with other OR mapping tools
  5. Learning Curve

If your evaluation seems to be positive against the above items, then go for it. In short, there should be a proper justification for using such a framework. You should not go with some one's advice, rather try it out by your own.

Anand Patel
That's good advice. We are already in the process of developing a prototype. We are also using CodeSmith to generate the templates.
MaSuGaNa
+1 for prototype
Rubens Farias
This framework does not play well with the DDD (Domain Driven Design) methodology. Give a thought to DDD (Domain Driven Design) + NHibernate for ORM.
Anand Patel
Rocky Lhotka believes that objects are about behavior and not data. Which he followed from David West in his "Object Thinking" book. While Active Record and CSLA both have Insert,Update,Delete functionality, they are no way the same concept. in Active Record the object is _data_ or infact is represent a database table.
Ricky Supit
Here is the link where he talked about "Object Thinking" http://www.lhotka.net/weblog/ObjectThinking.aspx
Ricky Supit
Csla doesn't have anything to do with Active Pattern...
B Z
+4  A: 

Hello,

The learning curve of CSLA isn't too bad but be prepared to spend some time reading in the book. We have taken care of a lot of the learning curve for you by generating a DAL (Parameterized SQL or Stored Procedure support) for you, so it adds an ORM feel to CSLA only because it manages the DAL for you if you choose. But you can completely use it as just a set of BO templates. I find that active generation makes it much easier to upgrade to newer versions of CSLA as well as add functionality without having a strong need for an intermediate class.

Thanks -Blake Niemyjski (Author of the CodeSmith CSLA Templates)

Blake Niemyjski
Thanks and great job on the templates. We are looking to press ahead with them in our SQL 2008/ Oracle 10g / Visual Studio 2008 / TFS 2008 environment and so if you have any further info on how best to integrate CSLA into this setup I would be very grateful.
MaSuGaNa
Thanks! We are planning in one of these releases, possibly the current one, of adding support for Oracle and MySQL. It would be very easy to implement Oracle support (a small portion of a day at the most). If your interested in helping let me know.
Blake Niemyjski
+1  A: 

CSLA is a business object framework. There are many strategies for dealing with Data access - there is much overlap between ORM and data-access. I have had a lot of success using Linq-to-SQL in a Data Access Layer to simplify development. I think this is an approach that will work for you - especially given (based on your comments) your need to support both SQL Server and Oracle.

Using a seperate DAL is well documented in Rocky's book and samples on www.lhotka.net

As far as TFS - it's an ALM tool for Source Control, Project Managment and Build Automation. You would want to put the CSLA Source under source control like any other code. The simplest approach would be to include CSLA in your solution.

Another approach would be to compile it seperately and use a file reference in your projects to the CSLA.DLL. In TFS Automated build there is a property group which you could put the path to that DLL on your build server.

Lastly Rocky sells CSLA training videos on his website at http://download.lhotka.net/default.aspx?t=Core38

fuzzbone