Friday, October 01, 2004
« Magenic Technologies Acquires Empowered ... | Main | More SF book recommendations »

It seems that TheServerSide.net has a debate going this week about O/R Mapping. As part of the discussion, one of the invited debaters made the following comment about CSLA .NET:

 

“…everyone just "loves" CSLA, afterall its got every feature imaginable, was created by one of the best "experts", is the subject of books and user groups -- and yes there are code gen templates for it. Now don't get me wrong, I think Rocky is a great speaker and teacher (and great in person too -- I have met him), but I think he would agree that CSLA is an example for teaching how to do something and should not really be the expected to be perfect out-of-the-box -- and its not. I've personally seen a project spend way too much time and effort doing things because they chose this route -- they had to constantly go and add/remove/modify pieces to their chosen framework -- and I've heard many others that have similar problems.” (link)

- Paul Wilson

 

It is not the most professionally phrased comment, but this gentleman has previously made similar comments in other forums as well, so I thought I should provide an answer.

 

I think it is important to note up front that Mr. Wilson sells an O/R Mapper tool, and so has some bias. It is also important to note that I have written numerous books on distributed object-oriented architecture, and so I have some bias.

 

CSLA .NET is intended to be a learning or teaching vehicle. It is often also useful in its own right as a development framework.

 

Different people write different types of books. For instance, Martin Fowler’s excellent Patterns of Enterprise Application Architecture came out at about the same time as my .NET Business Objects book. In many ways he and I are targeting the same demographic, but in different ways. Fowler’s book stays at a more abstract, conceptual level and teaches from there. My book is more pragmatic and applied, teaching from there.

 

As an aside, I find it wonderful how some of the patterns in Fowler’s book can be found in CSLA .NET. I think this goes to show the power of the design pattern concept – how patterns emerge in the wild and are documented to help provide a more common language we can all use in future discussions.

 

But back to books. We need books that give us broad theory and concepts. We also need reference-oriented books that give us basic usage of .NET, C# and VB. And we need books that try to span the gulf between the two. This is where I’ve tried to live for the most part – between the theory and reference content. To do this is challenging, and requires that the theory be distilled down into something concrete, but yet rich enough that it isn’t just more reference material.

 

The way I’ve chosen to do this is to pick a way of creating distributed object-oriented applications. Are there other ways? Oh yeah, tons. Are some of them good? Absolutely! Are some of them bad? Again, absolutely. Is CSLA .NET good? It depends.

 

Certainly I think CSLA .NET and the rest of the content in my business objects books are good for learning how to apply a lot of theory into a complex problem space. I think that many readers use ideas and concepts from my books in conjunction with ideas from Fowler’s books, the GoF book and lots of other sources.

 

A side-effect of writing a book on applied theory is that the theory does actually get applied. This means that the book includes a pretty functional framework that can help build distributed object-oriented applications. This framework, CSLA .NET, can be useful as-is in some scenarios. There’s a vibrant online forum for discussion of my books and CSLA .NET where you can find numerous examples where people have applied the framework to help solve their problems.

 

Many of those people have also modified the framework to better suit their needs or requirements. This is nothing but good. In several cases, modifications made by readers of the books have been applied back into the framework, which is why the framework is currently at version 1.4, where the book described version 1.0.

 

Does CSLA .NET fit every need? Of course not. No tool meets every need.

 

It is particularly good at creating performant, scalable line-of-business systems that involve a lot of data entry and business rules and relationships. It supports people who build a good object-oriented business entity model, because it provides for virtually unlimited flexibility in translating the object data to arbitrary (relational and/or non-relational) persistence targets (databases, etc).

 

It is not particularly good at creating reporting systems, large batch processing systems or systems that are very data-centric and have little business logic. There’s also a cost to the data mapping flexibility I mentioned as a benefit – because with that flexibility comes more work on the developer. If you have either a non-complex data source or you are willing to tie your object model to your data model then CSLA .NET isn’t ideal because it requires that you do more work. If you want your object model to mirror your data model then use a DataSet, that’s what it is designed for.

 

But the real thing to keep in mind, above all else, is this: there is a set of functionality that must exist to build distributed object-oriented enterprise applications. This includes data persistence, UI design support, business logic, organization of layers and tiers, state management and more.

 

The issues that I address in my business objects books and CSLA .NET are addressed in every enterprise application. Whether formally or informally, whether through reusable or ad-hoc implementations – everything I address happens in every enterprise app. (And a whole lot more things I don't address are in every enterprise app!!)

 

The idea that CSLA .NET has “got every feature imaginable” seems to imply that it has extra stuff you don’t need. The fact is that you will address every issue it covers one way or another, plus numerous other issues. You might address them differently that I did, and that’s great. But you will address them.

 

You can address them in an ad-hoc manner in each app you write. You can address them through a framework, or you can address them through tools. You might address them through a combination of the above.

 

But I’ll say this: the ad-hoc approach is poor. You should opt for a solution that provides reuse and consistency. There are numerous ways to do this, CSLA .NET is one and I imagine that Mr. Wilson’s O/R mapper tool is another. And there are various commercial frameworks and other O/R mappers out there as well. You have a lot of choices – which is indicative that this is a healthy segment of our industry.

 

The fact is that at some point you need to make hard decisions within your organization that move from the theory of design patterns and architecture down to the practical and pragmatic level of code, and you only want to do that once. It is expensive, and it does nothing to solve your actual business needs. All this code that does data persistence, layering, tiering, data binding and whatever else is just plumbing. It is necessary, it is costly, it is time-consuming, and it provides no direct business value.

 

And be warned – if you buy or otherwise acquire a framework or tool set (CSLA .NET, O/R mappers, whatever) you will almost certainly need to modify, extend, add or remove bits and pieces to make it fit your needs. If you do this by buying a black-box component of any sort, you’ll end up extending or modifying around the component, while if you acquire one that includes code you may opt to make the changes inside or outside the component.

 

Obviously you can acquire a component that does less work for you – something targeted at a narrow task. In that case you might not need to modify it, but you must face up to the fact that you will need to write all the other stuff that it doesn’t do. It isn’t like you can escape the requirement for all this functionality. Every app has it, whether you do it in a reusable form or not is up to you!

 

So when it comes to frameworks, O/R mappers and all this other plumbing: do it once – build it, buy it, cobble together products to do it. Whatever suits your fancy.

 

Then get on with building business apps and providing actual value to your organization.


Friday, October 01, 2004 5:12:12 PM (Central Standard Time, UTC-06:00)
Is it me or this really sounds like a good book foreword?

Regards

Mate
Saturday, October 02, 2004 12:16:49 AM (Central Standard Time, UTC-06:00)
Whenever I read his material, it makes me want to turn to dust and let the wind carry me away tired, dry, and useless.
Sunday, October 03, 2004 6:33:03 PM (Central Standard Time, UTC-06:00)
Rockford,
I compare programming to the art of cooking. Different cooks prepare steaks differently at the end of the day, they have the same meal, and it might taste differently, but will contain the meat. Now, what we have is a broader issue. Microsoft was never eager to teach us, the basics of programming, OOP or design patterns and I do not blame them. They are in business of selling software that makes our life of the developers easier. That is why you see, so many application written with no architecture behind them.

.NET 1.x had to be done currently and so many folks were left behind, because you have to have some knowledge (OOP, Design Patterns, you name it). How many developers truly understand the need for architecture? Not that many, oops did I say that? Last week, I interviewed two candidates who claimed to be Architects, who claimed they developed with .NET Framework since it is earlier release, but when I asked them name me one Design Pattern. They were lost. What do they do? Well, they just write business application, which would have to be redesign. Now, you start throwing O/R mappers, application frameworks and they are lost.

I am personally tired of the discussions what is the golden bullet. At the end of the day Paul Wilson or Rockford Lhotka framework, can fit the bill. What people really need is good training in the basic concepts of OOP.

My two cents, Maxim

[www.ipattern.com do you?]
Monday, October 04, 2004 10:06:54 AM (Central Standard Time, UTC-06:00)
An important idea in the piece is that if you build professional software, you will have to address the same issues CSLA does, one way or another. One of the reasons I appreciated Rocky's business objects books was that I had already worked on such a system in VB6 and, sure enough, had to solve every single major problem he dealt with in the books - rules, parent-child, undo, and so on. Wish I'd had his examples and ideas beforehand.

The product is not the code, it's not the tools, it's not the framework or the components. It's what you learn while doing the work.

Walter Boggs
Tuesday, October 12, 2004 3:04:11 PM (Central Standard Time, UTC-06:00)
Sorry if you have taken my comments, or any others (which have been very few), about CSLA not being a silver bullet as being something more -- they certainly weren't intended to be any more than that. I think my comments were very much in spirit with your own, when I met you personally, and some of the others on the Magenic team, on the project that I used CSLA on at PRG. It wasn't evil or bad or anything else like that, nor did I say it was so -- it just wasn't the silver bullet that many in the CSLA community (but not you) act like it is -- and of course you are right that it isn't my style either so I am biased. My frustration is that when some of us say things like this (that CSLA isn't a silver bullet), and say that some in the CSLA community act like it is, the replies are that we said more than we did and that the no one says it is a silver bullet. All I can say is we have a user group in Atlanta that does nothing but CSLA (which does imply a lot of complexity), and we had someone from Magenic (not you or most of the other worker bees) "sale" our VP at PRG that CSLA was a silver bullet (and like it or not the fact that you wrote a book on it was the factor that convinced my VP that this must the case). Anyhow, I don't have anything against CSLA, nor code gen which works well with CSLA, but I do communicate enough with others that have had similar issues with the perception of CSLA that I have simply on a few occasions noted that it is not a silver bullet. I would not claim my preference is either -- and in fact I go out of my way to give people a list of other products that compete with my and have more functionality when necessary (of course usually they cost more and/or are more complex, but nonetheless the point is that mine is not a silver bullet either).
Wednesday, October 13, 2004 7:58:55 AM (Central Standard Time, UTC-06:00)
"And be warned – if you buy or otherwise acquire a framework or tool set (CSLA .NET, O/R mappers, whatever) you will almost certainly need to modify, extend, add or remove bits and pieces to make it fit your needs. If you do this by buying a black-box component of any sort, you’ll end up extending or modifying around the component, while if you acquire one that includes code you may opt to make the changes inside or outside the component."

What makes you think this is true? Since when can a framework not be a framework, but does it need modification to be usable? You refer to the GoF book. That's good. THen you'll also understand that there are patterns which allow you to modify a framework without 'working around it' but simply by customizing it using standard OOP procedures. We're not in VB5/6 land, remember.
Wednesday, October 13, 2004 3:19:32 PM (Central Standard Time, UTC-06:00)
The following was posted on my blog:
http://weblogs.asp.net/pwilson/archive/2004/10/13/241957.aspx

Retraction:
I have said a few times that there was a bug in CSLA, at least in an early version, where DataReaders do not get closed. I should instead have said that this bug was in the examples of how to use CSLA, which are found in the CSLA book, not in the CSLA core framework itself. That is a legitimate distinction, and I erred in not making it, but it should also be noted that many people follow these examples of usage.

Positive Note:
If you are new to object-oriented programming, or at least business objects, then I heartily recommend Rocky Lhotka's books. The CSLA framework that he develops in his books is one of the best explanations of how to build a business object framework available (if not the best). I owned the previous VB6 version, and now have a .NET version, and I can honestly say that I have learned from Rocky's books and speaking.

Negative Note:
As I have said a few times, and has apparently offended some CSLA groupies, you should never assume that any framework or tool is perfect or ready-to-use in your situation. CSLA, like any framework or tool, may include things that you do not need which can make it heavy, it requires a commitment to learn, and it may not save as much time as other tools when used manually (without code gen). Be prepared to make changes.

Disclaimer:
I sale an O/R Mapper, if you can call $50 and free upgrades for live selling, which I think is one of the simplest tools out there, as well as being easy to extend when necessary. It has some overlap with CSLA, so it can be perceived that my comments are made to increase my sales. Of course, CSLA and my O/R Mapper can most likely be used together, since what my mapper does is what CSLA leaves undone, and vice versa.

Personal Note:
I hope that this somehow proves that I am at least somewhat objective and positive, and not just "trash" talking, misleading, or being dishonest when it comes to CSLA. There are many styles and possible solutions in .NET -- I have used CSLA on a major project and do not want to do so again -- but I can say the same about many other techniques I have used in the past too. Feel free to similarly critique my O/R Mapper, but please don't make it personal and simply "trash" talk me for simply stating my opinions. Finally, I would like to say thank you to the many people that have positively appreciated my comments in the past -- and were glad to know they were not alone in their experiences -- and I understand why most of you preferred to only communicate in private emails to avoid the very groupie talk that I have fell into.
Comments are closed.