1

I watched a video series from Uncle Bob on Clean Code. He makes a few points on architecture which I both agree with but I believe could have clarification.

From Uncle Bob:

  1. The Interactor is connected using Boundaries
  2. Architecture should be fluid
  3. Trust your team

My Understanding:

  1. Use protocols (depending on language)
  2. I should feel free to write and change my code as needed, when needed
  3. For internal only applications, we have full control and we work together

However, if I don't need protocols then can I start by not using protocols and when it's necessary to use them I convert my classes/object to conform to protocols. My main concern is the development overhead of protocol (albeit small) is not beneficial until there is >1 user of the Interactor. And 99% of the time in my apps there generally is only one Controller/Presenter connecting to my Interactor.

Further, does all that above also apply to using public/private? I generally use private when I want to convey that function shouldn't be called. Generally because it's a helper, it's dangerous to call it directly, etc. But why would I spend the effort making everything private just because?

14
  • Can you provide a citation/reference for "Architecture should be fluid" please? – Robert Harvey Jul 9 '20 at 18:43
  • I've never read "Clean Code", but I am familiar with Uncle Bob. There's very little architecture you need to write if you are using a container project, kind of like what Spring is for Java. Someone else has done all the hard work, and you only need to specify what the dependencies are. The container will take care of all the hard work of aligning them. – Berin Loritsch Jul 9 '20 at 20:35
  • 1
    @BerinLoritsch I've read various articles on his website, but I recently watch all 6 lessons / 2 days of Clean Code. You can search the videos with "Clean Code - Uncle Bob / Lesson 1". – Michael Ozeryansky Jul 9 '20 at 22:35
  • @RobertHarvey His video has a slide with "A good architecture allow major decisions to be deferred". cleancoder.com has a quote "A good architect defers the decision about how the system will be deployed until the last responsible moment.". Why would you need a citation to make a comment on the question? – Michael Ozeryansky Jul 9 '20 at 22:39
  • Because I don't really understand the context of the statement "Architecture should be fluid." – Robert Harvey Jul 9 '20 at 23:11
2

In this article I make the case that Clean Architecture is unsuited for basically most, if not all circumstances. It is in any case unsuited for object-oriented projects, because it is at it's core simply not object-oriented.

You are not imagining it, it is not just overkill and over-engineering, it is positively harmful to have artificial (i.e. technical, i.e. non-domain) boundaries inside your application, especially if you won't need it at all.

The architecture should be fluid? I have no idea what that is supposed to mean. The architecture should reflect the domain! That's it. In your design, you have a chance to communicate with future readers. What would you want to tell them? Do you want to tell them about the domain, or do you want to tell them about your l33t architecture skillz? Maybe you want the latter :), but your readers might appreciate the former.

1
  • I did read a lot of your article. My understanding of Clean Code / Architecture is not a concrete methodology and I don't see it directly related to OOP. While a lot of Uncle Bob's examples are Java, his explanations or language agnostic. He's talking about a way to separate the development of the code. How do you tell people about your domain without architecture? Do you use an over abundance of comments, because then I recommend clean code. – Michael Ozeryansky Jul 13 '20 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.