Clean Architecture by Example in 5 Minutes

Sdílet
Vložit
  • čas přidán 15. 06. 2024
  • Applying the Clean Architecture is actually a lot simpler than you might think.
    Join me at the black board and I show you how to design a feature step-by-step following the rules of the Clean Architecture.

Komentáře • 23

  • @medrlayman
    @medrlayman Před 9 měsíci +5

    One of the best youtube video on Clean Architecture, especially the explanation on dependency inversion principle which is the key technique of achieving inward dependency.

  • @being_aslam_tiger
    @being_aslam_tiger Před 9 měsíci

    Thanks for making this video, please make more similar videos.

  • @n0pee349
    @n0pee349 Před 9 měsíci

    Thanks for this amazing tutorial. Do you have in plans to do an video about your VsCode configuration that you are currently using for .Net?

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci +1

      Thx! No plans for such a video yet but I just now published a community post, showing the VsCode extensions I have installed ;-)

  • @theseenandunseen
    @theseenandunseen Před 5 měsíci +1

    Very informative. Any chance on sharing an example on how this would translate into code (from start to finish)? Thank you !

    • @AboutCleanCode
      @AboutCleanCode  Před 5 měsíci +1

      @shadowbit. Have a look here czcams.com/video/6hIg86y9HuE/video.html and here czcams.com/video/pfhDO_hZixw/video.html and here github.com/plainionist/AboutCleanCode 😉

    • @theseenandunseen
      @theseenandunseen Před 5 měsíci

      @@AboutCleanCode Will definitely have a look at your suggestions.
      Conceptually I think you did an awesome job in this video at describing how each component ought to be linked and/or connected in order to abide to the principles of the clean architecture, however, considering that I'm not a developer by trade, some aspects are a bit confusing and having a 1-to-1 mapping with a tangible example would make things much clearer; (especially when it's in Java or C++). I will give it a go nonetheless based on your described setup.

  • @DarrellTunnell
    @DarrellTunnell Před 8 měsíci

    Thank you for the video! Im really curious to know what software you use for these animated diagrams! Would you share?

    • @AboutCleanCode
      @AboutCleanCode  Před 8 měsíci

      @DarrellTunnell I wrote my own small web app base on maxGraph JavaScript library 😉

    • @DarrellTunnell
      @DarrellTunnell Před 8 měsíci

      Wow! Would you consider making a video about that project? I like working with diagrams as code and use things like mermaidjs or plantuml. They are very good for static diagrams but they don't have any support for animation. At the same time my PowerPoint skills are not great and I find it a huge time sink. So really I want a way to work programmatically but in a terse way, to create animated diagrams like yours! I'd be curious to learn from your experience before I attempt something myself :-)

    • @AboutCleanCode
      @AboutCleanCode  Před 8 měsíci

      @@DarrellTunnell At the moment the project is still in prototyping phase but I plan to release it as open source in some point of time. Until then I would recommend MaxGraph JS, it also has great examples to start with github.com/maxGraph/maxGraph/tree/development/packages/html/stories

  • @igeoorge3g
    @igeoorge3g Před 9 měsíci

    Any recommended repo that applies to this?

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci +1

      @igeoorge3g the source code of most of my videos you can find here: github.com/plainionist/AboutCleanCode for this particular video I have no such repository. the case was derived from one of my projects at work which I cannot share online.

  • @botondvasvari5758
    @botondvasvari5758 Před 7 měsíci

    what if I have an embedded system. A mortar that should fire,tilt,pan. There is target and environment. The mortar has motors which are stepper motors they can change in the future. Are the motors part of the domain or I/O ?? (I have a motor abs class which has a calculateRequiredStepsFromAngle(angle) and there is an implementation based on the current motor) I want it this to become clean arch.

    • @AboutCleanCode
      @AboutCleanCode  Před 7 měsíci +1

      @botondvasvari5758 generally speaking, in Clean Architecture the I/O layer contains the code which interacts with the "outer world". In case of an embedded system this would be all code directly depending on the hardware and/or Operating System and/or device drivers. Any logic we can abstract from these technical details, any decision making i would put into the "entities" (domain model) or "use case" (application logic) layer. If you have a "motor" object which represents the real physical motor and which contains data and computation logic, then this class should be part of the domain or use case layer. But this class must not have any dependency to technical details. For that you would have a dedicated class e.g. MotorDevice which would then be located in I/O layer.

  • @botyironcastle
    @botyironcastle Před 9 měsíci

    I think domain is an implementation detail. Usually we need different repres of the same object when we send it back as a response and different repres when we save into a dstastore, so DTOs. I always see too simple samples.

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci

      This example is very simple, agreed, but I have chosen it intentionally to focus on the basic ideas. I think it could be easily scaled to multiple responses, presenters and data stores. Or do you miss a particular aspect?

  • @marcin2828t
    @marcin2828t Před 9 měsíci

    I like the video, can you make similar one about Onion?

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci

      Thx! I add it to my todo list ;-)

    • @marcin2828t
      @marcin2828t Před 9 měsíci

      Looking forward to see it! One question : why did you stick to Clean Arch and not an Onion Arch? Any particular reason?@@AboutCleanCode

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci

      @marcin2828t I do stick with CA because I like the domain and the app logic being the center of the architecture with all technical details pushed to the most outer corners. I think this improves changeability and maintainability of the software a lot because business logic and technology can evolve independently.
      As to my understanding Onion Architecture is quite similar to CA but so far I didn't had a deeper look at it or even used it in any project - maybe I should change this ;-)

    • @marcin2828t
      @marcin2828t Před 9 měsíci

      Thank you for your answer. I'm the onion-man, and from what I can tell both architectures are not so different in the concept at all. I think that main difference is that layers and building blocks are named and sometimes placed differently. Soon I will be starting a new project for company I work for and I want to try something new. CA is one of the options. On the other end sits concept of Domain Model from DDD which I may incorporate into old good Onion without taking anything else that comes with DDD. There is a chance that I will make a terrible wrong decision and turn into Victor Frankenstein ;) @@AboutCleanCode

    • @AboutCleanCode
      @AboutCleanCode  Před 9 měsíci

      Personally, I think DDD and CA fit quite well together - same is probably true for Onion Arch and DDD