n 层设计混乱
谁能给我提供一个网页链接,其中显示了 n 层设计的正确方法以及 VS2005 和 C# 中的示例源代码?
我有一点很困惑,如果我创建如下所示的层:
UI
|
Business Logic
|
Data Access
那么我怎样才能实现真正的 OOP?
因为在 OOP 中,所有活动都应该封装在一个对象中。
根据我的想法,这应该是这样分层的:
UI
|
Business Objects
|
Business Logics
|
Data Access
但是当尝试像这样设计图层时,我遇到了循环引用问题。
我的一个朋友告诉我,他用反射解决了这个问题。
那么将 ac# 应用程序分层的行业标准方法是什么?
一个紧迫的问题是,哪一层托管 OR 映射?
Can anyone provide me with a web link that shows a correct approach of n-Layered design with example source-code in VS2005 and C#?
I am confused in one point, If I am creating layers like the following:
UI
|
Business Logic
|
Data Access
then how can I achieve true OOP?
Coz In OOP all activities should be encapsulated within an Object.
According to my thought, this should be layered like this:
UI
|
Business Objects
|
Business Logics
|
Data Access
But when trying to design layers like this I experienced Circular Reference Problem.
One of my buddy told me that, he solved this problem with Reflection.
So what is the industry-standard approach in separating a c# application into layers?
And a burning question is, which layer hosts the OR-Mapping?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
替代文本 http://amrelgarhy.com/ files/uploads/9-1-2009%208-58-14%20PM.png
有时会这样:
替代文本 http://amrelgarhy.com/files/uploads/9-1-2009%208-59-14%20PM.png< /a>
正如您在前面的两张图中看到的,ORM 位于数据访问层
alt text http://amrelgarhy.com/files/uploads/9-1-2009%208-58-14%20PM.png
And Some times goes like this:
alt text http://amrelgarhy.com/files/uploads/9-1-2009%208-59-14%20PM.png
So as you see in the 2 previous diagrams, the ORM located in the data access layer