Question

In a 3-Layer application, from better design/architecture point of view, can/should i instantiate a business class (which resides in Business Layer) in Presentation Layer? I mean, is that a bad practice? If so, then what are ways to refer to any business object from the Presentation Layer?For example, how i'm gonna save an "Employee" object in session state if i can't create it in the Presentation Layer(code-behind)?

Was it helpful?

Solution

If you don't instantiate the business object in the presentation layer, how would you call it? So you shall have to do it. Of course, if you wish the code for business layer to run off somewhere else, you can think of services. But still, at that time you shall instantiate the proxy from the business/service layer only. So just go ahead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top