抽象三层应用程序的数据层 (DAL)
作为我上一个问题的延续,(请参阅https://stackoverflow.com/ questions/3737848/creating-a-loosely- Coupled-scalable-software-architecture
有人建议也抽象 DAL,就像我从三层项目的表示层抽象 BLL 一样。关于如何执行此操作有什么建议吗?我是否还需要在 BLL 和 DAL 之间建立一个工厂?我需要你们的意见……谢谢。
As continuation to my previous question, (see https://stackoverflow.com/questions/3737848/creating-a-loosely-coupled-scalable-software-architecture
Someone suggests to also Abstract the DAL like I abstracted the BLL from the Presentation Layer on my three tier project. Any suggestion on how to do this? Do I also need a factory between the BLL and the DAL? I need your input guys.. thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的是——在对表示层进行抽象之前,我会在 BL 和 DAL 之间进行抽象。
你的其他问题中使用的方法似乎是合理的 - 你为什么不重复使用它呢?
Activator.CreateInstance()
(正如您在其他问题中使用的那样)是正确的方法。Interesting - I'd put abstraction between the BL and DAL way before I'd do that for the presentation layer.
The approach used in your other question seems reasonable - why don't you just reuse that?
object
, which you can then cast as it's returned - i.e: at the point in the BL where it's being called.Activator.CreateInstance()
(as you've used in your other question) is the right way to go.