Stairway pattern implementation

后端 未结 3 883
小蘑菇
小蘑菇 2020-12-08 02:34

I came across \"Stairway\" pattern description in the \"Adaptive code via C#\" book and I don\'t really understand how this is supposed to be implemented:

3条回答
  •  渐次进展
    2020-12-08 03:10

    In that case Client project should contain references to both Service and ServiceImplementation. Those references will be used only to create IoC container which will be used be DI. At application start you need to register all interface implementations in IoC container.

    If you will implement ServiceImplementation against Service interface and you will code Client based on Service intereface then there will be no dependency on ServiceImplementation.

    You can also see how Stairway pattern is implemented in samples for "Adaptive Code via C#":

    https://github.com/garymcleanhall/AdaptiveCode/tree/master/Sprints/sample-sprint2-markdown

提交回复
热议问题