A factory pattern is used to instantiate the ServiceHost because it is, potentially, a polymorphic type that the hosting environment should not instantiate directly.
英
美
- 由于ServiceHost可能属于宿主环境不应直接实例化的多态类型,因此使用工厂模式对其进行实例化。