Replies: 4 comments 3 replies
-
This would break the code architecture by introducing a framework dependency in the domain and making domain framework dependent. This is explained in the hexagonal architecture documentation. It is totally a possibility but it means switching to a new architecture because this one would not be relevant anymore |
Beta Was this translation helpful? Give feedback.
-
Sorry, if you refer to this, it's very light on specifics, let alone the benefits what kind of benefits does the separation of the ModuleFactory and ApplicationService brings? |
Beta Was this translation helpful? Give feedback.
-
Yes, I'm refering to this. You can also read this from the original architecture author. Hexagonal architecture is meant to protect the domain. If you remove this there is no point in this code architecture. This mean you can also delete the rich domain model because it will become bloated over time (without any protection). This may sound stupid but I have seen it many times in companies I'm working with: it is worth it to protect the domain model, no matter what. On the frontend, we are going around this by injecting the secondary port in the primary adapter which is totally fine since the domain still don't depend on any framework but, on the backend it's not a good solution to do that. I'm not saying that choosing hexagonal architecture & rich domain models was a good idea. I'm saying that you need some code architecture to protect the domain otherwise it's useless to do it. We can discuss the pro & cons of this coding style but they are the root of JHipster Lite so the value of the discussion won't be that great |
Beta Was this translation helpful? Give feedback.
-
There is no domain protection happening around the modules, so I don't understand your point. The ApplicationServices dont adapt to anything, they just pass the input to the Factories. (Even if you are saying that JHipsterModuleProperties class is part of the domain, or part of the infrastructure, they are used as is, so no adapters or no conversions are needed) I think, even if you have a convincing theory, that you can follow, and promise some advantage:
So I'm not saying, that choosing hexagonal architecture was wrong, or using rich domain model is not nice or effective.
I also saw a couple of times, when someone thought they should build a future proof architecture, it is very easy to balloon up the lines of code with 2-3 times, without any benefit (just the constant burden, that even the most basic change of adding a new field needs modifying ~100 LOC) |
Beta Was this translation helpful? Give feedback.
-
As I see, all the
***ApplicationService
are just creating a***ModuleFactory
and call it in theirbuildXYZModule
function.It seems, that we can remove them all, and add
@Service
annotation to theModuleFactory
, and use it directly in the***ModuleConfiguration
.Beta Was this translation helpful? Give feedback.
All reactions