Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Understanding CSLA...

Posted on 2006-07-03
5
Medium Priority
?
476 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Loops Section Overview
Suggested Courses

610 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