Coder Social home page Coder Social logo

abstractfactory's Introduction

Clean Architecture 的書時,對於第 11 章的 DIP 依賴反轉原則中的第 P77 中的『工廠模式』

有朋友在看 Clean Architecture 的書時,對於第 11 章的 DIP 依賴反轉原則中的第 P77 中的『工廠模式』如果實際的套用在程式碼裡該怎麼做?又該怎麼分層呢?我將這個 Class Diagram 撰寫成一個 .NET 5 分層的範例並使用整潔架構。

我聲明並先假定這個 Abstract Factory 的用途並不是 DDD 中的 Factory 喔!既然是 ServiceFactory 我就假設它是需要由 Infrastructure 來時做實作的,並套用 Clean Architecture 模式,所以我一樣將 IServiceFactory 放置在 Application Service 中,ServiceFactory.cs & ConcreteImpl.cs 都在 Infrastructure 中實作,所以範例程式碼如 Github:

abstractfactory's People

Contributors

wugelis avatar

Watchers

 avatar

Forkers

weichunkao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.