Solved

Understanding CSLA...

Posted on 2006-07-03
5
473 Views
Last Modified: 2010-04-16
I'm trying to understand the concept of CSLA (and using it with n-tier), but I'm having trouble with it (even after browsing Lhotka's book).
Let's say I have a webform (presentation layer) that will insert a product into the products table.  My webform instantiates my Products class (business layer), and calls addProduct(a,b,c,d, ...).  Products.addProduct creates and configures the SQLCommand to run the SP (data layer) that inserts to Products. Finally, the SP returns an error code (i.e. 0 or i) which another method in Products will interpret as "An error occurred" or "The Insert was
successful".  This string will then be sent to the webform.
How do I add CSLA to this architecture?

Thanks.
P.S. - I always thought that in 3-tier architecture the data layer was another class that would make the actual call to the database . The business layer would only make sure that the data being sent to the data layer was correct and that the information sent to the windows/web form was user-friendly. Is that 4-tier architecture?
 
0
Comment
Question by:MyersA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 5

Expert Comment

by:pgloor
ID: 17036167
Sorry, I cant help. You might consider posting your question here:
http://forums.lhotka.net/forums/5/ShowForum.aspx
0
 
LVL 5

Accepted Solution

by:
pgloor earned 100 total points
ID: 17036675
Let me come back to your question and try to give an answer.

You probably have a 3-tier architecture with a Presentation layer, a Business Logic layer and a Data Access layer in mind. Extending this model to a 4-tier architecture typically extends the Business Logic layer into a Web server and an Application server part. UI and Data access remains the same.

Now, in CSLA the Business Object encapsulates both, the Business Data and the Business Rules. However, there is still strong logical separation of the data access code, since CSLA .NET specifically defines and requires the implementation of four data access methods in the business class:

DataPortal_Create
DataPortal_Fetch
DataPortal_Update
DataPortal_Delete

See the following link for details posted by Lhotka:
http://www.lhotka.net/Articles.aspx?id=b99dfec2-c079-4b85-98df-ea3582c28386

I don't know any details regarding CSLA and Stored Procedures. I know while the CSLA framework contains some support for the execution of Stored Procedures thru the DataPortal, Lhotka doesn't recommend the use of it.

See the following link for more information posted by Lhotka:
http://www.lhotka.net/Articles.aspx?id=2e980a8b-8bdf-4f83-ab18-12e40c6bb04d

I hope this helps a little for a better understanding. I'm still not sure whether to call this 3-tier or 4-tier (or even 2-tier in some cases without SP).
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question