简体   繁体   English

Using business object in presentation layer

[英]Using business object in presentation layer

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)?

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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM