Difference Between BusinessBase and CommandBase

Difference Between BusinessBase and CommandBase

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


Chandu posted on Monday, November 10, 2008

Hi,
I was going thru the Expert CSharp 2005 and have a dumb question.
What is the difference between BusinessBase and CommandBase?
-
Chandu

skagen00 replied on Monday, November 10, 2008

BusinessBase is a fundamental editable business object. Project & Resource are two of these in the ProjectTracker sample. Typically you can create, fetch, insert, update, and delete these.

CommandBase is really more of a object designed to provide the ability for additional server-capable functionality besides the CRUD of a business base and to provide procedural type abilities for the business base (or other classes) to invoke - "Exists" is a common command base that people will often expose via a static method on the BusinessBase. CommandBase will typically shuttle some criteria over to the server (does id #4 exist?) and perform an operation and most times set internal values within itself about "how things went" so that you can pull the result after invoking the functionality of a CommandBase object. i.e. did the Profile exist?

No question is a dumb question but I'd say you have a lot more reading to do! :)

JonStonecash replied on Monday, November 10, 2008

This is somewhat simplistic but a Business Object combines data and behavior and a Command is almost pure behavior executed against the data store.  The Exists command is classic, but another common command is to apply some kind of SQL set operation to the database.  For example, delete all of the rows in the XYZ table that meet some condition.  There might be some data passed in to the command to include in the condition and some data (such as a count of deleted rows) passed out to indicate the results of the command.

Jon Stonecash

Chandu replied on Tuesday, November 11, 2008

Thanks Guys.
Started delving into CSLA.
So far looks fine, but somehow I have a feeling like the CSLA is a heavy beast for an application and how would App performance fade out in real time.
But probably as I go through the articles and code I can get a much bigger picture

rsbaker0 replied on Tuesday, November 11, 2008

I've been very impressed with CSLA performance thus far, even on an underpowered desktop machine with a 1-tier deployment. And remember, one of the benefits of CSLA is that you can scale up to more tiers with the same code base as your requirements evolve.

It's a bit to get your head wrapped around at first, but then you realize that all your objects work the same way and you don't have business logic tied up in the user interface layer where it can't be reused for another type of interface.

It's all good...

 

Copyright (c) Marimer LLC