I think "reliable event bus" deserves its own project, unrelated to Modultith. It would be wonderful to be able to just add a starter to the project and have fault-tolerant ApplicationEvents out of the box.
Okay so I have watched a lof of talks about moduliths from the SpringIO conference and from the Spring developer channel and while most of them were all talks and going indepth, this video is actually the one i love most because it actually examples. Short but really relevant examples. Now I feel like I have better understanding of the Spring Modulith project. Thank you very much Long...
And when the compensating transaction fails for whatever reason, we need to trigger a compensating transaction for a compensating transaction. :) Oh, I miss the good old times..
The reason why you also support a layered architecture in addition to a vertical architecture is because, and I've seen people do this, they access certain types of code in the wrong spots because their compiler gave them access to it. Also you can have layered code that you don't want to expose to a higher level of module. Not everything in my model needs to be accessible at the controller level. Here's a good example, It is a good design to use getters and setters with hibernate in order to facilitate appropriate lazy loading when dealing with collections and joins, hibernate has yet to support fully immutable objects. So I make package protected setters, I do not want my controller calling my setters... They are simply there to facilitate hibernate. If I need to set something I should use a more domain oriented method. Now, should everything go into a top-level controller package with no sub packages? No that's not a good idea. I think we should be doing both vertical and horizontal slicing. A decent question is though... Should it be, say, registration.controller or controller.registration? As far as other concerns with public types... There's JPMS and it should be getting used. If you really really want to hide your public types you should be using jpms. If you can't use JPMS please go open bugs with the relevant projects or comment on the existing ones that you want this because they seem to be under the impression that people don't want compile time safety and non-transient dependencies Only. Which spring modulus doesn't appear to deal with? The problem of transient library dependencies getting pulled on to my compile time class path which I've seen in the real world result in people directly using code that later broke because they depended on something directly that we didn't intend to depend on directly. Probably because their IDE suggested it.
Layered architecture is not best practice anymore. I see what you’re saying is completely right but nowadays you think more in Onion/Hexagonal architecture but the point remains: all architectural patterns are there to control data flow as well as support dependency inversion.
Can you fit in Webflux in a meaningful way? Let's say you have a handler module with a listener that has a reactive complex flow, do you gain any benefits from that? A new event will start a new reactive chain so probably we don't gain anything?
If you want to call them the same name you could put them in a different package... And then use jpms to control what you export... 😂 And then you'll have to fully qualify your package name. I wish Java had type aliases... Because every library has a Component class... You say that you want that but if you actually did it you'd realize on any significantly large code base you would run into the problem of trying to open the right type with your IDE and being frustrated with your auto completion. So that's not only about Java but your IDE and general human readability.
Your programming style is interesting, but don’t forget: you’re working alone. Youngsters, make sure to always put Maintainability at the front. Your current as well as future coworkers will appreciate it. Putting 20 classes and records into one file looks fancy in this video but is hell for teams bigger than 2…
Now having watched this whole thing. I feel like the only convincing usage of it is for the documentation purposes. I'm actually a bit concerned about how smart it is since you were showing it throwing errors on internal packages. Arguably makes using jpms for more control harder. Jpms will enforce only exported packages be be accessible. In other words an internal package is always an internal package and you can't access it outside of that jar as long as you don't export the internal package. Perhaps another video covering modulith with jpms And enforcing that things like jpa annotations aren't accessible on your controller... Of course this assumes that you can get jpms working. I'm about to take another pass on that and my code and see what spring boot is throwing these days.
I dont think that is an error that would make the overall application not to start. I think its just a way to verify if you are doing things right. I am not so sure, I haven't tried out any spring modulith codebase
I think "reliable event bus" deserves its own project, unrelated to Modultith. It would be wonderful to be able to just add a starter to the project and have fault-tolerant ApplicationEvents out of the box.
i have no idea how nodejs and python are doing this, spring makes it so easy for Java
Java ecosystem is thriving with spring lately.
Okay so I have watched a lof of talks about moduliths from the SpringIO conference and from the Spring developer channel and while most of them were all talks and going indepth, this video is actually the one i love most because it actually examples. Short but really relevant examples. Now I feel like I have better understanding of the Spring Modulith project. Thank you very much Long...
One little doubt. How to rollback the first part of transaction if needed?
We need to trigger a compensating transaction. When @Async is used it is altogether runs under different thread and in different transaction.
Use SAGA pattern to handle loosely distributed transactions such as these.
And when the compensating transaction fails for whatever reason, we need to trigger a compensating transaction for a compensating transaction. :) Oh, I miss the good old times..
@@djxak everything comes with a price.
It's a big doubt. It requires proper planning around events and know which can be async and which should be synchronous transactions (all-or-nothing).
Why is the Java Jigsaw module system completely ignored?
Great explanation, on point and with working example. Thank you so much!
as always, super amazing!! 🇵🇸🇵🇸🇵🇸
Thanks for a very useful introduction, as always
Thanks, indeed very useful module.
The reason why you also support a layered architecture in addition to a vertical architecture is because, and I've seen people do this, they access certain types of code in the wrong spots because their compiler gave them access to it. Also you can have layered code that you don't want to expose to a higher level of module. Not everything in my model needs to be accessible at the controller level. Here's a good example, It is a good design to use getters and setters with hibernate in order to facilitate appropriate lazy loading when dealing with collections and joins, hibernate has yet to support fully immutable objects. So I make package protected setters, I do not want my controller calling my setters... They are simply there to facilitate hibernate. If I need to set something I should use a more domain oriented method.
Now, should everything go into a top-level controller package with no sub packages? No that's not a good idea.
I think we should be doing both vertical and horizontal slicing. A decent question is though... Should it be, say, registration.controller or controller.registration?
As far as other concerns with public types... There's JPMS and it should be getting used. If you really really want to hide your public types you should be using jpms. If you can't use JPMS please go open bugs with the relevant projects or comment on the existing ones that you want this because they seem to be under the impression that people don't want compile time safety and non-transient dependencies Only. Which spring modulus doesn't appear to deal with? The problem of transient library dependencies getting pulled on to my compile time class path which I've seen in the real world result in people directly using code that later broke because they depended on something directly that we didn't intend to depend on directly. Probably because their IDE suggested it.
Layered architecture is not best practice anymore. I see what you’re saying is completely right but nowadays you think more in Onion/Hexagonal architecture but the point remains: all architectural patterns are there to control data flow as well as support dependency inversion.
It's a pretty nice video! It's nice to see spring boot evolution.
Could this also work with Apache Kafka?
this is wonderful, you gave me a great idea to test it out, the demo is amazing!
Can you fit in Webflux in a meaningful way? Let's say you have a handler module with a listener that has a reactive complex flow, do you gain any benefits from that? A new event will start a new reactive chain so probably we don't gain anything?
Thanks a lot! It was really great demo
Can similar if not the same things be achieved with Spring integration with respect to messaging between independent components of a system?
What about separate datasource per module? Would be nice to have per module decoupled and isolated datasource configuration.
multiple classes in 1 file, my eyes are bleeding 😱
Many thanks Josh for such lovely content! 🙏🏿
How it will work when we scale like when we have more than one instance of services.
Would Spring Modulith be a good fit for a small workflow type project?
Muchísimas gracias, aunque no entiendo porque tantas dependencias pero sigo aprendiendo el modulith.. Saludos
how do you get autocompletion/suggestions in the application.properties by just typing springd at 4:43 for example?
They are using premium version of Intellji
nicely put
where is the code brother? :(
incredible content btw
Great stuff!
ApplicationModuleListener is being deprecated
What is your first fav place on the internet ?
RUclips:)
It is production.
How to handle pressure in Scrum Sprints as a Java Developer
Conduct bi-weekly bare-fist fight ceremonies after your retros with your dev team and your pm. Scrum is an expansible framework after all.
Micro services in monolith?
it was so damn nice !
Lombok is not preferred anymore: that is understandable
curl was used instead of httpie: why?
I prefer HTTPie myself, but I suspect the answer is that Curl is installed on pretty much every command-line environment you'll ever need to access.
@@simongeard4824 Your reply makes me wonder if there's a single binary execution for httpie and there is. I used to install it like a python app.
Lombok isn't going anywhere any time soon; java is years behind without it
cUrl is the defacto standard, most tools work with it
what a loaded 38 minutes!
If you want to call them the same name you could put them in a different package... And then use jpms to control what you export... 😂 And then you'll have to fully qualify your package name. I wish Java had type aliases... Because every library has a Component class... You say that you want that but if you actually did it you'd realize on any significantly large code base you would run into the problem of trying to open the right type with your IDE and being frustrated with your auto completion. So that's not only about Java but your IDE and general human readability.
Your programming style is interesting, but don’t forget: you’re working alone.
Youngsters, make sure to always put Maintainability at the front. Your current as well as future coworkers will appreciate it.
Putting 20 classes and records into one file looks fancy in this video but is hell for teams bigger than 2…
Decoupled, not decomposed.
Now having watched this whole thing. I feel like the only convincing usage of it is for the documentation purposes. I'm actually a bit concerned about how smart it is since you were showing it throwing errors on internal packages. Arguably makes using jpms for more control harder. Jpms will enforce only exported packages be be accessible. In other words an internal package is always an internal package and you can't access it outside of that jar as long as you don't export the internal package. Perhaps another video covering modulith with jpms And enforcing that things like jpa annotations aren't accessible on your controller... Of course this assumes that you can get jpms working. I'm about to take another pass on that and my code and see what spring boot is throwing these days.
I dont think that is an error that would make the overall application not to start. I think its just a way to verify if you are doing things right. I am not so sure, I haven't tried out any spring modulith codebase