Where to start?

Where to start?

Old forum URL: forums.lhotka.net/forums/t/6926.aspx


bioluminescence posted on Monday, May 11, 2009

Hi,

I am an experienced programmer and want to see what CLSA is all about, what books do you guys recommend I start off with?

I see that CLSA focuses on business objects, but what about the data access layer?

Is this CLSA a really good framework if implemented correctly?

I am a ASP.NET and C# developer, is CLSA a good choice for web apps as well?

Thanks
Brendan

Tom_W replied on Monday, May 11, 2009

Hi Brendan

I'm going up the CSLA learning curve at the moment.  I would start out by reading everything on the main CSLA site and then have a good search through this forum for things like 'learning CSLA'.  Skimming back through the last 10-15 pages should get you a lot of the answers you're looking for.

If you like what you see from all of that then the next stop is the Expert c# Business Objects book, which goes into a lot more detail on everything.  Reading that in conjunction with looking at the ProjectTracker sample app will teach you a lot more.

In truth, so far I have found that there is a bit of a shortage of additional example apps which is making learning the framework more difficult, but I'm getting there now.

Anyway, like I say the specific answers to your questions are well documented in these existing posts on these forums so that's definitely the best place to start.

bioluminescence replied on Tuesday, May 12, 2009

Thanks for the answers :)

I have already bought the book, just waiting for it to arrive.

Where do I get that sample app from?  In the book?

What do you use for your DAL?

I started working through the design patterns from www.dofactory.com.  Will CLSA replace the BLL?  Or will it just enhance it?

How is it going with your learning curve?  You making alot of success?  How long have you been learning CLSA?

Thanks

Fintanv replied on Tuesday, May 12, 2009

I have been using CSLA since the 1.1 days and am an ardent supporter.  I have used it in several enterprise level applications to great success.  The learning curve is steep at first, and never ends since Rocky (and the community) are continually pushing it to new heights.  The main concept to wrap your mind around is that CSLA is used to build business objects that are based on behavior, not the underlying data model.  As for DAL's, you get to choose what you want.  CSLA is not dependant on any one.  I have used both straight sproc calls internal to the BO's, and I have also encapsulated all DB calls to a DAL class where part is generated via code generation, and part is custom. 

Good Luck!

Tom_W replied on Tuesday, May 12, 2009

Where do I get that sample app from?  In the book?

You can download the framework and the samples here:  http://www.lhotka.net/cslanet/download.aspx

What do you use for your DAL?

At the moment I'm using Linq to SQL as it's what the ProjectTracker example app uses.  I like the way this strongly types all of your sproc parameters, so will probably use it in the production code.

However, it is worth noting that MS have said they aren't going to develop Linq to SQL further, so it is probably worth looking at the Entity Framework... however the EF is still a pretty immature technology. 

There is also absolutely nothing to stop you using ADO.NET (and indeed if you download say version 2.0 of CSLA you will find that uses ADO.NET for the DAL), or indeed just about any other DAL technology you can think of!

I started working through the design patterns from www.dofactory.com.  Will CLSA replace the BLL?  Or will it just enhance it?

The book will explain the patterns Rocky favours, there is an excellent chapter on this.  CSLA definitely wants you to work a certain way, so if you have very fixed ideas on the 'right' design patterns for the app you are writing then it is worth making sure they match up with the Behaviour orientated approach favoured by CSLA.

How is it going with your learning curve?  You making alot of success?  How long have you been learning CLSA?

I wrote a post on this recently called 'Learning CSLA', so that may be worth a read.  But in short; the learning curve is steep and whilst I'm getting the hang of it now, it has taken weeks of reading and coding to get even the basics going. 

Probably a big part of this for me is that the framework uses so many aspects of .NET and several of these are areas I haven't used extensively before, so I'm learning .NET theory as well as CSLA theory in places. 

Where I'm really suffering is with the lack of sample code.  The ProjectTracker sample app is not designed to demonstate best practice, it is designed to show as many features of CSLA as possible. Because of this it is quite difficult to follow in places and it can take a while to get your head round what the code is doing.

What I've done is to come up with a simple four object model of my own and I've been slowly working what I learn from each chapter of the book into this little app.

The other problem I've found is that a lot of the book is focussed on how the framework works internally, which is incredibly useful when you are trying to diagnose why something isn't working as expected, and also as a general tool for learning advanced .NET theory.  What the book isn't so focussed on is providing a myriad of examples for common scenarios, which is the way I tend to learn best.

From my experiences so far I would guess it will take a good couple of months to get proficient with CSLA and a lot longer to be a real expert.

Having said all of the above, I think CSLA is an amazing body of work and for me it fits very closely to how I think apps should be designed, so I am determined to persist with it and use it.  As Joe Fallon often says though, your mileage may vary!

DocJames replied on Tuesday, May 12, 2009

Hi,

I would also suggest to take a look at some of the code generators e.g. CodeSmith with the templates from CSLAcontrib (http://www.codeplex.com/CSLAcontrib). That helped me a lot in the beginning.

For data access you can use the technology you wish. I use Csla 3.6.2 with ADO.NET and stored procedures for normal CRUD operations. In some objects I use Entity Framework for dynamic select queries (and still save the object with ADO.NET).

Please note that the CodeSmith templates use ADO.NET for data access in version 2.0 and Linq2Sql in version 3.6. But you can mix it the way you want.

Jimmy

Copyright (c) Marimer LLC