Should Business layer of the application be able to access Session object?

sarsnake picture sarsnake · May 29, 2009 · Viewed 7k times · Source

Say you have 3 layers: UI, Business, Data.

Is that a sign of poor design if Business layer needs to access Sessions? Something about it doesn't feel right. Are there any guidelines to follow specifically tailored to web app?

I use c# 2.0 .net

Answer

GreenieMeanie picture GreenieMeanie · May 29, 2009

No. If you had a "Controller" layer, you should access it there. Get what you need from the Session and hand it off to your business layer.