Understanding n-tier app - Shopping cart app  
Author Message
RBG





PostPosted: Architecture General, Understanding n-tier app - Shopping cart app Top

Hi,

Trying to understand what function fits in which layer.

I have a ASP.NET 2.0 web app .. a Shopping cart application.

Page Output caching is enabled on all Browsable pages.

The basic flow of the application is that, user first browses the web site anonymously. There are products and product categories. If he becomes interested in a particular product he logs into the website and then makes purchases. If he for some reason doesn't like his/her selection he/she simply logs out.

The web app captures the most browsed product categories and the Products that are Clicked the most. It also captures the Signouts and the purchases made by webusers.

The web app has three layers. Presentation layer which shows the product catalog and product categories

The Business layer which contains business logic and the DataTier which contains the database, datatables and stored procedures.

Thus even through the user borwses the catalog and the product categories in the Presentation Tier, I would assume that the statistics still need to captured into the database tables for getting the count of most browsed product categories and the most clicked products Am i right or is it that we can capture this in the Presentation layer/Business layer.

Similarly the signouts and purchases ... are these capturable in the Business layer.. i think these can be captured in the database Tier only for statistic purpposes (just like the Product categories) am I right



Architecture2  
 
 
Kareem Shaker





PostPosted: Architecture General, Understanding n-tier app - Shopping cart app Top

Hi,

I think if you add it at the business layer it would be better, for example you can add a new separate table into your database and let's say you have a method called

GetProductDetails(productID) and another one called

PurchaseProduct(productID)

as you have the product Id this way you can log each product id hit into the log table this way you could do how many hits you get for each action you are interested in such as purchace or viewing a product.

Regards,