doucheswag icon indicating copy to clipboard operation
doucheswag copied to clipboard

What about boundaries

Open lorenzomar opened this issue 10 years ago • 7 comments

It is one of the few EBI sample over the web. It is interesting. But where are boundaries?

lorenzomar avatar Jul 15 '14 09:07 lorenzomar

Pretty much anything that isn't an entity or interactor :)

So for example, the boundary for the place bid use case, includes it's dependencies (https://github.com/igorw/doucheswag/blob/master/src/Douche/Interactor/Bid.php) and whatever calling code executes the use case, in our case a silex controller (https://github.com/igorw/doucheswag/blob/master/src/DoucheWeb/app.php#L59)

davedevelopment avatar Jul 15 '14 09:07 davedevelopment

I'd argue that the Request and Response objects define the boundary. They define an interface between the domain and the outside world.

igorw avatar Jul 15 '14 19:07 igorw

The required dependencies are interfaces to the outside world as well, just not direct ones from the point of view of the usual calling code.

davedevelopment avatar Jul 15 '14 19:07 davedevelopment

Yes, when talking about boundaries I usually do so from a domain-centric viewpoint. As far as the domain is concerned, the database, web, etc. does not usually exist.

igorw avatar Jul 15 '14 20:07 igorw

Agree with you! Introduction of request/response define itself an interface to talk with interactor and to receive response from it. Doubts have arisen after watching the famous episode 7 of clean coders series where Robert C. Martin spoke of boundaries as interfaces to extend innthe delivery system to use interactors.

lorenzomar avatar Jul 15 '14 20:07 lorenzomar

well, basicly you could create an interface e.g. Interactable and let your controller implement it, then your controller action could call the methods to invoke, but i dont see the point to do it. I gues Uncle Bobs Drawings are Language Independant. If you have a java Application which runs as Process and listen to events on the GUI, there i gues it would make sence.

Personally i see the Request,Response and concrete Implementation of interfaces as Boundaries.

On my learning Project https://github.com/OpenTribes/Core the application is dependant on the src folder but the src folder is not dependant on the silex folder. so if i switch from silex to lets say zend, i have to reemplement the boundaries and controllers and other framework specific stuffs.

Indeed Uncle Bob shows oft that Interactor uses Boundary Interfaces to communicate, but i dont have a clue how and why should i do this in PHP :D

BlackScorp avatar Jul 16 '14 07:07 BlackScorp

Same opinion as you @BlackScorp. I am currently in the process of learning and I am developing a small portal of ads (eg Craigslist). So I have the opportunity to study all aspects of the project (domain design, web delivery, CLI interactions, validation, maybe API, etc.). If you want to collaborate or just give me some feedback, I can give you access to a private repository. What do you think?

lorenzomar avatar Jul 16 '14 09:07 lorenzomar