You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I recently work with Hexagonal Architecture that would set my path to latter be interested in spring-modulith, I came across a refactoring where I have on a "domain" layer a class ending with "ServiceApiFacade" with too many responsibilities. One of the methods of this facade class involves further dependencies so it was natural to isolate this method inside a new service class. That’s where the idea of isolated "Pure Component" as the one we found in ReactJs came to me, in addition to the fact that spring-modulith allows async event-based communication between components from either same or different modules just like ReactJs would bubbled-up event from child to parent component.
What I meant by "Pure Component" in isolation without dependency injection is a way to compose the behaviour of a "Pure Component" based on composition of behaviours of its parts without relying on external states.
At the end, since spring-modulith want to ease testing of components without relying on external states, with a "Pure Component" A 3 parts A1, A2, A3, instead of doing dependency injection through constructor before using the behaviour of its 3 parts A1, A2, A3 and then combine their behaviours, wouldn’t it be nice to just have a composition operation on component level - the same way modules do with asynchronous communication - to tie together the behaviour of the parts without having to rely on them as external states to the "Pure Component".
I currently don’t know the model or the details to build such "Pure Component", but I believe that having them will enhance the way we build test and complement nicely what spring-modulith already achieved so far.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As I recently work with Hexagonal Architecture that would set my path to latter be interested in spring-modulith, I came across a refactoring where I have on a "domain" layer a class ending with "ServiceApiFacade" with too many responsibilities. One of the methods of this facade class involves further dependencies so it was natural to isolate this method inside a new service class. That’s where the idea of isolated "Pure Component" as the one we found in ReactJs came to me, in addition to the fact that spring-modulith allows async event-based communication between components from either same or different modules just like ReactJs would bubbled-up event from child to parent component.
What I meant by "Pure Component" in isolation without dependency injection is a way to compose the behaviour of a "Pure Component" based on composition of behaviours of its parts without relying on external states.
At the end, since spring-modulith want to ease testing of components without relying on external states, with a "Pure Component" A 3 parts A1, A2, A3, instead of doing dependency injection through constructor before using the behaviour of its 3 parts A1, A2, A3 and then combine their behaviours, wouldn’t it be nice to just have a composition operation on component level - the same way modules do with asynchronous communication - to tie together the behaviour of the parts without having to rely on them as external states to the "Pure Component".
I currently don’t know the model or the details to build such "Pure Component", but I believe that having them will enhance the way we build test and complement nicely what spring-modulith already achieved so far.
Thanks you.
Beta Was this translation helpful? Give feedback.
All reactions