工厂、提供商和服务之间的区别?
工厂、提供商和服务这三个术语有什么区别?
刚刚进入 NHibernate 及其存储库模式(POCO 类等)。
What is the difference between the terms Factory, Provider and Service?
Just getting into NHibernate and its Repository pattern (POCO classes, etc).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
工厂:通过将一堆位组合在一起,或者根据某种上下文选择类型来组装类
提供程序:提供程序是微软“发明”的东西(基本上是一个抽象)工厂模式)是一种创建工厂工厂的方式,或者具有允许工厂可交换的通用工厂接口。它在 MS Web 堆栈中广泛使用,作为保持组件可配置性的一种方式。
服务:服务是一组相关的功能。想象一下,如果你水平分割你的架构,你有一个“业务逻辑”层,如果你垂直分割,你将拥有服务。
Factory: Assembles classes, either by composing a bunch of bits together, or choosing type based on some kind of context
Provider: Provider is something microsoft "invented" (basically an abstract factory pattern) that is a way of doing a factory of factories, or having a common factory interface which allows factories to be swappable. It is used all over in the MS web stack as a way to keep components configurable.
Service: A service is a group of related functionality. Think of it as if you are splitting your architecture horizontally, you have a "Business Logic" layer, if you split that vertically you will have services.