A
A
Abc Edc2015-11-07 08:22:59
Software design
Abc Edc, 2015-11-07 08:22:59

Question on reading (Hexagonal architecture)?

Recently I read habrahabr.ru/post/267125
Finally!
Long wanted rashn edishn something to find about this!
But I just want to clarify one point, I understand that everything is very figurative and although the names of the patterns have something in common with laravel, this can be used anywhere.
But still, in Laravel 5.1, the same command bus from 5.0 was cut out. And only JOB remained, but as I understand it, it is generally needed only for the sake of the handler using the command, but in the job, the handler will be called immediately after the constructor. That is, if all these 3 assistants are combined into one, as they did in 5.1, then this is even better, right? all processing will be divided roughly into 4 job'a(command,handler,commandBus'a) ? that is, one starts the transaction, the other creates the main entity and then the other two that then bind to it, or is it still in one handler?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-07
@gleber1

You did not catch the essence of the idea of ​​​​hexagonal, apparently. In particular, the whole point of the hexagonal is to separate the layers from each other using dependency inversion (not to be confused with the dependency container or IoC). In particular, to separate your code from the framework code. Next come concepts from onion architecture. The hexagonal only describes what should be at the boundaries of the layers.
No, this is just a simplification. In general, this increases the dependence of your code on the framework code, and separating the user cases and handlers themselves into layers will no longer work.
Now describe your case in the form of a user case. When do you need this? And what about the forms? Forms are part of the interface, which is what we want to isolate our application from.
in short .. it’s better not to practice hexagonals yet, you don’t need them yet. All of these methods serve a specific purpose. And if you don't have a reason for this, like... the ability to quickly organize another interface to the application, for example through MQ, or you have a need for layer isolation for better testability of these... Or you have a complex database architecture ( which sounds unlikely when using an active record) and you want to use CQRS to make it easier to work with them...
You must clearly understand why this is all necessary. Otherwise, there is a chance that you will only make the architecture of your application worse. It's just that this kind of complication is simply not advisable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question