Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryu1/0d312c2c5a58f4f84a5ba02ecf0b86e2 to your computer and use it in GitHub Desktop.
Save ryu1/0d312c2c5a58f4f84a5ba02ecf0b86e2 to your computer and use it in GitHub Desktop.
Design Pattern

Difference between a Factory, Provider and a Service?


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

ファクトリ: ビットの束を一緒に構成するか、ある種のコンテキストに基づいてタイプを選択することにより、クラスをアセンブルします

プロバイダー: プロバイダーは、マイクロソフトが「発明した」(基本的には抽象的なファクトリパターン)もので、ファクトリのファクトリを実行する方法、またはファクトリを交換できる共通のファクトリインターフェイスを備えています。MSWebスタック全体で使用されます。コンポーネントを構成可能に保つ方法として。

サービス: サービスは関連する機能のグループです。アーキテクチャを水平方向に分割する場合は「ビジネスロジック」レイヤーがあり、垂直方向に分割する場合はサービスがあります。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment