G
Guest
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) 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 and 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.
I'm having trouble with it (even after browsing Lhotka's book).
Let's say I have a webform (presentation) 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 and 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.