3 ms·
I don't see ports-and-adapters (aka Hexagonal Architecture) mentioned. Is that because you don't like it / don't find it useful?
by JayBazuzi 9y ago
I don't see ports-and-adapters (aka Hexagonal Architecture) mentioned. Is that because you don't like it / don't find it useful?
- jdlshore 9y agoI don't feel like I fully understand it.
- JayBazuzi 9y agoP-and-A makes Simulators possible, which are the one kind of test double I'm happy with. But your pattern language seems complete without it, so maybe I don't need it as much as I thought. Simulators fit right where you have Nullable Infrastructure. Having a null object and a real object, instead of a single object with both null and real behaviors is how I'd normally organize things. I write my Focused Integration tests so they can be run against both the real and the simulator, to ensure that they both agree on the contract. And just like the Nullable Infrastructure, I can use the simulator in tests. However, the real with with Ports-and-Adapters isn't the simulators (even though everyone notices that first). It's the way a good Port abstraction lets you organize your code well, writing it in terms that make sense in your domain, instead of in terms of the dependency. This is worth exploring further.
- jdlshore 9y agoOne of the key ideas of the Nullable Infrastructure is that all the semantics of the infrastructure class remain exactly the same other than disabling external communication. So any logic inside the infrastructure code still runs. This is important because we don't have broad integration tests. That's why the null code is inside the infrastructure, instead of using the classic Null Object pattern. It's also a major difference between it and classic test doubles. And perhaps your simulators?