Difference between a Factory, Provider and a Service?

谁说我不能喝 提交于 2019-11-28 13:49:09

问题


What is the difference between the terms Factory, Provider and Service?

Just getting into NHibernate and its Repository pattern (POCO classes, etc).


回答1:


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.



来源:https://stackoverflow.com/questions/1849618/difference-between-a-factory-provider-and-a-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!