I advocate avoiding the use of the Separated Interface pattern unless an interface is actually useful. I covered this in "Implementing Domain-Driven Design" in the "Domain Services" chapter. At the time and still today, frameworks such as Spring advocated using interfaces right next to the single implementing class. In Java, this was the typucal outcome:
ProposalService
ProposalServiceImpl
When scanning code, I learned filter in pairs. It's annoying because if you have a single implementation, (a) you have to maintain two sources, (b) the interface buys you nothing, (c) it's noisy, and (d) it's ugly.
So .NET developers will say that doesn’t happen to them because:
IProposalService
ProposalService
Yay! What? Less ugly, still all the other stuff. Besides, do you really say "I proposal service" to business collaborators? I refuse to, and I hope you don't. So now the noise is on the interface. Great.
Okay, if your blood isn't boiling by this point, you're probably wondering when Separated Interface is useful. Look no further than the pattern definition, a la P of EAA:
"Defines an interface in a separate package [namespace] from its implementation."
And:
"You can improve the quality of its design by reducing the coupling between the system's parts. A good way to do this is to group the classes into packages and control the dependencies between https://t.co/lb69KSSedx can then follow rules about how classes in one package can call classes in another - for example, one that says that classes in the domain layer may not call classes in the presentation package." [PofEAA] (reference below)
The two package/namespace (DDD Module) situations are:
1. Different implementations
2. Separation of concerns with loose coupling
I list "different implementations" first because that's the typical argument *against* Separated Interface. Huh? Yeah, "you'll almost never have more than one implementation." Sure, but this misses the whole reason behind point 2.
A chief architectural concern is loose/weak coupling, including not coupling business concerns with technical concerns. And there's another such concern: *direction of dependencies*.
Whether you are using Ports and Adapters or Layers, direction of dependencies matters. And if you are using Layers, the only way to keep yourself out of a bind with direction is to move the Infrastructure layer to the top. This is embodied in the Dependency Inversion Principle.
Bingo. You've got to declare an interface in a lower-level layer and put it's *even* single implementation in the Infrastructure. And that's the mentality that the beautiful and beautifully simplistic Ports and Adapters buys you. It's guides a way of thinking, not just a structure.
So, you want to be an architect? Then design like one. Hackers will hack.
P.S. I think this is my first blog post in what used to be a micro blogging app. I think I'll capture this in a blog post with pictures and all.
[PofEAA] https://t.co/tzKNIYGyDU
@bethcodes I usually talk about why development of new features tend to take longer (cost more) as a system gets larger and older, which we IMO can reduce by continuously keeping the code base sound.
Even finance folks seem to understand that. We developers must remind them, though 😉
Yay, I am not the only one to say that pull request reviews are of little value and slows everything down.
Thanks, @jessitron, for this insightful article.
What if we treated our team like a distributed system and required a quorum for writes?
It might solve the problem of slow pull request reviews.
https://t.co/mdTWOrvaLt
The articles on empowered product teams continue to inspire some great conversations that have helped me to uncover additional areas of product confusion. I just published a new article on a fundamental but often misunderstood topic: https://t.co/59NSuDpO2z
@VaughnVernon@TotherAlistair and his Heart of Agile boils Agile down to the 4 Words: Collaborate, Reflect, Deliver, Improve. I agree that it describes the Delivery aspect quite well.
@TotherAlistair and his Heart of Agile boils Agile down to the 4 Words: Collaborate, Reflect, Deliver, Improve. I agree that it describes the Delivery aspect quite well.
I think agile comes down to this:
1. Define work that needs to be done
2. Select work that can be done in ~1-3 days (iteration)
3. Determine if that work produced enough value to deploy (increment)
4. Repeat
Issues with this? Even inspect and adapt are there. #KillCeremony
@bakevin@sehlhorst@lissijean IME I've seen #Agile influence the evolution of #prodMgmt positively & negatively.
On the latter, worse case is the cast system that has arisen by attempts to scale by splitting team facing PO vs outward facing PM rather by pairing full stack product people of diff. experience.
Check it out, the Defense Innovation Board has come up with 6 questions to see whether a project fits the term agile or is "agile BS" ! I'm personally pretty happy with these questions: If you had to change one or more, what would you choose?
https://t.co/9oWiO2JZqm