Getting started, very confused.

Getting started, very confused.

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


Sue D. Nymme posted on Monday, April 07, 2008

Hi all,

    I have a medium-sized database application, written in SQL Server 2000 and Perl.  Actually, it's a whole set of applications.  I am trying to migrate to C#.

    A few months ago, I bought and read "Expert C# Business Objects", the 2004 edition.  Great stuff!  It's pretty much exactly what I am looking for.

    Instead of typing a billion lines of code, I came to lhotka.net to download the project code.  It was then that I found that the CSLA described in the book is horribly out of date.  I downloaded the latest, but it didn't work under the version of Visual Studio that I had.  I have since upgraded to VS2008.  I downloaded CSLA 3.5 and this is where I am, tearing my hair out.

    The project is now H-U-G-E.  I scarcely know where to start.  I built it, and it compiled with no errors, but I am trying to figure out where to get started in building my business objects. I am vaguely trying to follow along in Chapter 7 of my book, but I'm not sure if I'm doing things right.  The book I have focuses very strongly on the nuts and bolts, what is going on under the hood.  This is great, it is absolutely wonderful to know the flow of what is happening where, but it makes setting up a class to just USE very difficult -- I have to pick out a concept, skip over a few pages of low-level data flow, pick out another concept, etc.

    And I don't even know if I'm doing things right.  The 2004 book may have no correlation to the current CSLA.NET version.  Do I need to buy a new book?  The website's store has two current books: "Version 2.1 Handbook" and Using v3.0".  The 2.1 Handbook says that it "expands upon" the "Expert Business Objects" books, that it is not a replacement for them.  The store says that the Using 3.0 book is "completely focused on how to use the new features in version 3.0".  So it *sounds* like I need to buy BOTH books, in ADDITION to the book I've already bought.

    I don't mean to sound like I want to cheat Mr. Lhotka out of an honest living, but I've already spent $50 on one book; must I spend $55 on two more?  And will they help?  From the descriptions, it sounds like I will have to refer to all three as I go along.  This sounds tedious.

    What I *want* is *one* book, or online reference, that tells me how to *use* the CSLA.NET tool set.  I know what my design is; I know the concepts of how CSLA.NET works and operates under the covers; what I need is to put the two together.  I am lost in what project files need to be set up how and where.

    I am moderately new to .NET programming; I have written a few apps.  I have over 15 years of object-oriented programming experience, over 20 years of C, 12 years of object-oriented Perl, 15 years of SQL and database programming, and maybe two years of C# and .NET.  So I have a good programming background, but am rather a novice in .NET and Visual Studio, and I'm having a damned hard time trying to find my way around.

    Now, part of this problem is not Mr. Lhotka's fault.  .NET is huge, and there's a lot to learn.  I'm doing okay in that area, but I'm still on the upslope of the learning curve.  I am fascinated by the details of how CSLA works (it's quite elegant), but at the end of the day I have a job to do, and I want to use CSLA for what it was designed for: so I won't have to think about the implementation, and so I will simply be able to use my business objects in my applications.

    I apologize for the long-winded post, but I feel strongly that this is an important issue.  Are there any "get started quick" references for CSLA?  Are there any high-level references for *using* (not grokking the internals of) it?  So far all I have found is a nice CSLA class diagram, and a very short glossary of terms.

    Any help is greatly appreciated.  Thanks.

Patrick.Roeper replied on Tuesday, April 08, 2008

If you are going to use Csla 3.5 you will have to wait until 3rd quarter for a book that talks about the new features Rocky added.

My suggestion would be to read the 2005 business objects book (the one you purchased) and use the 3.0.x Csla framework to code against. If you are trying to use .NET 3.0 features (WPF, WCF, ..) then I would buy the Csla 3.0 E-Book.

You should be able to take the knowledge you gained from reading the 2005 business objects book and reference the Csla 3.0.x project tracker example code in order to start building an application without any additional books. They are helpful of course, but I don't believe they will impede you from developing applications.

One last idea that might help is to listen to the latest dotNetRocks podcast Rocky did, http://www.dotnetrocks.com/default.aspx?showNum=330. He spends a fair amount of time talking about the history of Csla, the version numbers of the framework, and some other topics that might be of a direct value add for you.

dpetrancuri replied on Tuesday, April 08, 2008

Another possibility would be to consider attending a CSLA training class (3 day at present) offered by the only approved CSLA training organization, Dunn Training (http://www.dunntraining.com). As I understand it they are currently teaching only on CSLA 2.1 (perhaps someone can confirm or refute), but I believe they will be offering a more robust class that teaches CSLA 3.x this summer.

Respectfully,

D

JoeFallon1 replied on Tuesday, April 08, 2008

Hi Sue,

I was in your shoes 4 years ago - but luckily it was only CSLA 1.x that I had to deal with. But I was learning VB.Net, ASP.NET, CSLA, OOP, Codesmith, etc. all at the same time. It was quite overwhelming.

You should definitely review this website for CSLA 2.0 BOs: http://www.csladesktopref.com/ Chris was very active a while back  and built a nice site showing how to set up each kind of BO. The site is out of date now as Chris had other things to do but it is a good place to start for building up a template for each kind of BO.

The eBooks are in .pdf format - I thought the price was closer to $10 each but I have not looked at that in long time. Each is well worth the money if you want to understand the new features that were introduced at each level. Although the bulk of the 3.0 eBook deals with WPF, WCF and if you are not using them you don't need to read about them - it is just that there are a few other things that are worth knowing.

The key to just being able to "use my business objects in my applications" is to have a full grasp of the framework and each type of BO. Then you should have a code generator available to write 98% of the code for that type of BO. You can then hand write the other 2%. The issue is that now you have to learn about code generators and build a set of BO templates that match the style you want to use. I built my Codesmith templates using CSLA 1.x - it took about 3-4 weeks to get them working the way I wanted. When I upgraded to 2.x I re-visited the templates and spent another week or 2 getting them up to speed for the new style. (The jump from 1.x to 2.0 was huge but from 2 to 3 or 3.5 it is not so bad and there are far fewer breaking changes.) Anyway - I had learned quite a bit in the intervening months and the re-write left me with a better set of templates that used the features of CSLA in a better way. I happen to use Inheritance not Partial Classes because that is where I started in 1.x when there were no Partial Classes. The bottom line is that each style has its own quirks but both allow you to generate code in one file and then hand write code in another so that if you re-generate your code (add new fields to a table  for instance) then you do not lose the hand written changes.

I guess what I am suggesting here is that you build a template for each type of CSLA BO and then use them in a small project like Project tracker. e.g. use project tracker DB, add a table or two and then make new BOs and forms and get them to run. This way you can tweak your templates to get them to generate the right kinds of BOs and then test them inside a small working app to ensure you understand them.

Then when you go back to your huge project it will not be quite as overwhelming.

Oh - one key thing to have is a set of Base Classes which sit between CSLA and your BOs. These base classes (one for each kind of BO) may be empty at first but all of your BOs should inherit from them. Later you will find some common stuff in many BOs that you can simply move into your base classes and let all your BOs use. Very powerful. Allows you to extend CSLA quite easily.

Good luck and feel free to post questions on BO design or whatever.

Joe

Sue D. Nymme replied on Tuesday, April 08, 2008

Wow, a lot of really good information, plus some good resources for me to look into.  Thanks, everyone!

Copyright (c) Marimer LLC