Solved

Understanding CSLA...

Posted on 2006-07-03
5
472 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 93
Where does legacy ASP.NET initialize language? 2 101
C# Linq - Join two objects into one 3 53
Need to sort columns in DataGridView 4 64
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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