hey everyone, Im having a hard time on how to wrap my head around boundaries
lets say I have a system that will make primarily http calls to other systems
id like to create a protocol + record for some sort of HTTPService
it to facilitate dependency injection, testing & etc
is this a boundary HTTPService
? Another services like the UserService
will depend on that http service .. I know UserService
should be a boundary, but it doesnt make sense for a boundary to depend on another right?
Yeah, it only really makes sense if you need the decoupling.
You’re already decoupling your app from the implementation of UserService
so the HttpService
within it is just an implementation detail and not something consumers of UserService
will need to know about.
thanks for your input!
@plins
> but it doesnt make sense for a boundary to depend on another right
I don't think there's an issue with that. The point is for the boundary interface to be implementation agnostic. So whether your UserService
uses an HTTPService
or a Shrubbery mock to do the "heavy lifting" shouldn't matter.
From a slightly different angle, UserService
could be your boundary, where HTTPService
is a dependent component (not boundary) of an implementation of UserService
.
(Disclaimer: this is my interpretation of the goals of boundaries, as described at https://github.com/duct-framework/duct/wiki/Boundaries)