Why choreography even exists when it seems orchestration is way more better. Are their any application for choreography
@GregorGramlich4 күн бұрын
Thanks for the video. Unfortunately most of the examples for ports and adapter that I see, are very simple. This is fine to a start with, but when looking deeper I struggle with understanding how to do stuff in a real application. In your example: How would you deal with concurrent accesses to the WithdrawFundsUseCase. If the current balance is 80 EUR and there two concurrent withdrawals of 50 EUR, both read the 80 EUR and want to save with the new balance with 30 EUR. In a system that uses a SQL database and JPA Entities directly you might get an OptimisticLockException or something similar, but in your example it looks like you are completely decoupled from the database transaction. I could imagine, that you keep some Hash or Version number of the old state and send it while saving. But I am really interested in your answer.
@MarcoLenzo2 күн бұрын
This is a great comment! As usual, it's all about trade-offs! I'll just give you my honest opinion. We expect transactionality to be handled by the infrastructural layer or adapter. ACID transactions are a core feature of most database engines, so re-implementing them within our application's core would be redundant. The simplest approach is to add the @Transactional annotation on AccountService.withdrawFunds (which is the concrete implementation of the use case). Some might argue against using a Spring annotation in the core, but this concern seems misplaced to me. The annotation doesn't tie us to a specific transaction manager or database. It just declares that the method's operations should execute within a transaction. As for testing, this approach means that concurrency testing would primarily be handled through integration tests rather than being confined to unit tests within the core layer. Could we avoid using Spring @Transactional in the core? Certainly! We could replicate its behavior or adopt patterns like Unit of Work, two/three-phase commits, or optimistic locks (which are similar to what you described). This would eliminate the Spring dependency, but does the gain justify the complexity? In my view, it doesn't. In a distributed system, you eventually need to rely on the infrastructure to coordinate operations across multiple threads and processes. There's no way round it.
@MarcoLenzo2 күн бұрын
Just came to mind that you could even use the Jakarta @Transactional instead of the Spring one, and still have it being recognized by the framework. docs.spring.io/spring-framework/reference/data-access/transaction/declarative/annotations.html
@GregorGramlichКүн бұрын
@@MarcoLenzo Thanks a lot for the comprehensive answer. This makes a lot of sense. I was not aware that using the @Transactional annotation (JTA or Spring) might be an option. I thought that it might be "forbidden" in the core application. And I also was not sure that it would work after mapping from Account JPA Entity to Account Domain Object and back and then updating in the database. This ties your repository adapter implementation to a JTA aware implementation, if you want to handle transactionality. The MongoDB or HashMap implementation would behave differently from the JTA implementation for this concurrent call use case. So you need to know about the restrictions of your adapters for the driven ports, but this always applies (e.g. local file access vs. reading a file from a network). It seems to be another leaky abstraction problem. But as you said, it is a trade-off and probably not worth the effort to remove it.
@gustavosserra7 күн бұрын
In my limited experience, APIs were able to solve most of the problems. Async messages are valuable, but seldom their cost pays off. Again, just in my experience in areas that I've worked. It was easier to start simple and add more complex solutions only if necessary.
@MarcoLenzo2 күн бұрын
That's a fair point. Avoiding over-engineering (or complex solutions) is possibly the most important thing when developing software. It helps us deliver more quickly a system that's also easier to operate and extend in the future. Both functional and non-functional requirements typically determine if asynchronicity is really necessary. However, my gut feeling is that if you are fine with two microservices talking over API synchronously, there's a very high chance that those two components could be merged in a single deployable where code is segregated with proper modularization. Obviously, each case is different and there's no right or wrong: just trade offs. :)
@gustavosserra9 күн бұрын
This is gold!
@MarcoLenzo2 күн бұрын
Too kind!
@gustavosserra9 күн бұрын
Clear explanation. Thanks.
@MarcoLenzo2 күн бұрын
Thank you
@VolkerHett10 күн бұрын
I have some doubts about portability of containers. When I have to move a docker container from one host to another, I backup all data from the container, create a new container on the other host and restore the data. Trying to find all the containers files and transfering them to the other host never worked for me. Importing a VWmware VM into Proxmox or Virtualbox is a walk in the park compared to this. I'll hope Kubernetes will solve this, I do like the Idea of containers.
@MarcoLenzo9 күн бұрын
Yeah we'll see it later in the course how we can leverage several implementations of the Container Storage Interface (CSI) to manage our persistence. If you want to read ahead of time, a lightweight solution is Longhorn which is what I use in my home lab. It takes care of creating multiple copies of a volume in different nodes allowing pods (and containers) to be scheduled in any node even if they require persistence. Hope this helps
@melaniebrueggemann563711 күн бұрын
Die KI Aussprache / Übersetzung ist noch ausbaufähig ...
@MarcoLenzo9 күн бұрын
Yeah, I totally agree. It's a new feature from KZbin and it surely needs refinement!
@ttaylor991625 күн бұрын
Thanks, Super video. Although at 18:07 problems started. In the end took your GIT code for python, various errors (with connexion, etc).. but after a few hours worked. :)
@MarcoLenzo25 күн бұрын
Do not hesitate to contact me on my email if you need more support 🙏
@0dan126 күн бұрын
no free
@MarcoLenzo25 күн бұрын
Are you sure? I just checked and there's still a free plan
@darunomar3386Ай бұрын
Your content is super rich i wish you could improve the English accent, said with love and feedback ♥️🙏🏻 loved your video a d find it super useful
@MarcoLenzoАй бұрын
Hi :) Feedback taken and appreciated! 🙏 I'm doing my best but in the meantime I'm making sure to have all new videos with manually corrected subtitles. I just noticed this video does not have proper subtitles. I'll make sure to update it. I'll also cover other popular videos of mine. Have a great day!
@aneeshmulay7316Ай бұрын
Great video . Thanks for explanation
@MarcoLenzoАй бұрын
Thank you 😊
@softwarengineeringwithfabriАй бұрын
thanks for explaining hexagonal so well!
@MarcoLenzoАй бұрын
Thank you 🙏
@rishiraj2548Ай бұрын
Guten Abend
@MarcoLenzoАй бұрын
Good evening!
@padaladileep5906Ай бұрын
Nice explanation
@MarcoLenzoАй бұрын
Thanks for liking
@ToluwalaseAkintoye-jb2lmАй бұрын
pls how can i start my new project using hexagonal architecture in Go or java
@MarcoLenzoАй бұрын
Download a sample project. I have one linked in the video description and start from there. There are many more available scaffolds out there. If you're still stuck, contact me over email. You find the contact on my website.
@leomyskyАй бұрын
Thank you for the video
@MarcoLenzoАй бұрын
Thank you!
@XiaolongLu-j1tАй бұрын
atomikos and bitronix are solutions for XA(2pc) and database need support xa, is not alternative of saga. 🤔
@MarcoLenzoАй бұрын
Correct. Let me explain why I say the saga is an alternative to a distributed transaction. (Either / or) I say alternative because if you can afford doing distributed transactions, there's less value in adopting a Saga pattern. That said the two approaches could coexist but I see it as a rare scenario.
@XiaolongLu-j1tАй бұрын
@@MarcoLenzo yes, in my opinion,nowdays xa is not the first consideration in distributed tx for its poor capacity. in jdbc scenario, other solutations like Seata(AT mode) is better.
@MarcoLenzoАй бұрын
@XiaolongLu-j1t Thanks a lot for sharing. I never used Apache Seata. You gave me something new to learn!
@MarcoLenzoАй бұрын
Would you write a modern web application without Inversion of Control, i.e. without Spring or similar frameworks?
@aditramaputra20572 ай бұрын
Great info. Thanks for sharing 🙏
@MarcoLenzo2 ай бұрын
Thank you
@msausu2 ай бұрын
Agree!
@MarcoLenzo2 ай бұрын
👍
@msausu2 ай бұрын
Agree!
@MarcoLenzo2 ай бұрын
💪
@MarcoLenzo2 ай бұрын
Did you know you can use Kubernetes to implement any declarative API? Let me know if you wish a tutorial on this 🫡
@AntonArhipov2 ай бұрын
Thank you for the overview and highlighting the issues.
@MarcoLenzo2 ай бұрын
Pleasure
@josgraha2 ай бұрын
I use codeium but afaik it doesn't work with jetbrains ide
@MarcoLenzo2 ай бұрын
IntelliJ IDEA is my primary IDE and I use Codeium on it. If you prefer JetBrains IDEs, just give it a shot and see how it works for you.
@alan-2 ай бұрын
Helpful tips for working with ChatGPT
@MarcoLenzo2 ай бұрын
🙏
@ahmettek3152 ай бұрын
It was nice to see what I am already using for free was the tool that you suggest as github copilot alternative :)
@MarcoLenzo2 ай бұрын
Have you ever used ChatGPT for DDD or Software Architecture in general? 🤓
@rishiraj25482 ай бұрын
Good day greetings
@MarcoLenzo2 ай бұрын
Have a nice day you too!
@ayushprasad82072 ай бұрын
gr8 kontent
@MarcoLenzo2 ай бұрын
Thank you 🙏
@RoamingAdhocrat2 ай бұрын
any Sim City players will appreciate the colour-coding of the layers. Infrastructure = Industrial, Domain = Commercial, Presentation = Residential. Makes sense as the users live in the presentation layer :)
@MarcoLenzo2 ай бұрын
Good one! 😆
@RoamingAdhocrat2 ай бұрын
This was very clear - thanks!
@MarcoLenzo2 ай бұрын
Thank you!
@DorisCorey-j7i3 ай бұрын
Robinson Ronald Thompson George Thomas Jose
@MarcoLenzo3 ай бұрын
👋
@Johan-rm6ec3 ай бұрын
I use ChatGPT the limited free version. Downside is it hasn't a scope view about your questions. So to get what you want takes a lot of time. The good side it gives great code and overall quality is great.
@karthickjayaraman20903 ай бұрын
Perfect video for taking notes. Thank you boss.
@MarcoLenzo3 ай бұрын
Thank you
@zeeeeeman3 ай бұрын
Cody anyone? I use it VSCode, but It causes all kinds of errors in Intellij. It's not bad though -
@MarcoLenzo3 ай бұрын
I did have a few errors lately. However, they don't seem to affect the IDE negatively. Hopefully, they'll be solved in future updates.
@jairo_manrique3 ай бұрын
Hi Marco, great video thanks. Im a little bit confused on how manage order Items in order aggregate without expose the item set, how iterate over them, update item quantity (may be a easy method) and mapping to dto? And, what method explotion mean? I appreciate your advice a lot.
@MarcoLenzo3 ай бұрын
Hi, excuse me for the late reply. I'm not sure I understand your problem with the item set. Why don't you want it in the aggregate? It's fine having it there.
@MarcoLenzo3 ай бұрын
Hi! Excuse me for the late reply. Why don't you want the item set in the aggregate? You can have a set or list of VOs in an entity or aggregate.
@uchchhash-dev3 ай бұрын
Great video. Thanks for the precise explanation!!
@MarcoLenzo3 ай бұрын
Thank you!
@geekwithabs3 ай бұрын
Thanks for the video. Exactly what I wanted to know and what I suspected.
@MarcoLenzo3 ай бұрын
Glad I could help
@CC_FPV3 ай бұрын
The only problem I can see with copilot in Pycharm is that you don’t get the link in the run window when an error has occurred to ask the AI to explain etc. with the Jetbrains AI you do. Unless I’m missing something!
@MarcoLenzo3 ай бұрын
You are correct. JetBrains AI Assistant enjoys a way deeper integration with their IDEs than the competition. This is the reason why I keep testing it. I use JetBrains IDEs and if their assistant was on par with the competition I would happily use it too. Unfortunately my experience has never been extremely positive with their assistant. I'll keep on giving it chances though. More or less I experiment with it every quarter :)
@michalmakhadankar3 ай бұрын
Copilot. And I am satisfied so far.
@MarcoLenzo3 ай бұрын
Yeah I agree.
@FateflyYip3 ай бұрын
omg it is working...i cannot imagine it is free to use. Any limitation that i can use it per day?
@MarcoLenzo3 ай бұрын
As far as I know there are no limits when you use their base model. Limitations are on the use of other models like GPT4, etc.
@fele093 ай бұрын
been a week trying to get my head around. this is very simple to understand
@MarcoLenzo3 ай бұрын
Let me know if you are interested in a particular topic and I will do a video on it.
@YoQi-rm3xn3 ай бұрын
Setters shouldn't be private for RGBColor VO as rule of thumb ??? Creating VO with "new" and "public" constructor? Setter would return a new instance everytime of RGBColor, something is not good....
@MarcoLenzo3 ай бұрын
If you notice, RGBColor is a Java record. In Java records, all fields are (implicitly) final and there are no setters to foster immutability. Give it a try and let me know.
@YoQi-rm3xn3 ай бұрын
@@MarcoLenzo what is setRed setBlue and setGreen? They r not setters?
@MarcoLenzo3 ай бұрын
Oh now I understand what you are referring to. Those are examples of side-effect free functions. They are not typical setters. Maybe I should have given a different example naming the functions differently to avoid confusion. The idea is that VOs are not data containers with no behavior. It is fine for them to implement functions that act on its state. However, when this happens, we need to enforce immutability, thus we are forced to return new instances. This way there is no risk to change the state of some other object that was holding a reference to the initial VO. You can find this concept explained in the book by Vernon "Implementing DDD" in the chapter dealing with Value Objects. Hope this clarifies it. Excuse me for the poor example. Also search the web for side-effect free functions and you'll find a lot of material. I'll try to cover them in another video.
@YoQi-rm3xn3 ай бұрын
@@MarcoLenzo yes please, would b great
@lilivier3 ай бұрын
I tested both and Copilot wins easily.
@MarcoLenzo3 ай бұрын
Agree
@davidgg84624 ай бұрын
Very good video
@MarcoLenzo3 ай бұрын
Thank you
@davidgg84624 ай бұрын
Always good to
@MarcoLenzo3 ай бұрын
Thank you
@TheCodeConnoisseur4 ай бұрын
Fantastic
@MarcoLenzo4 ай бұрын
Thank you
@davidtheprogrammer4 ай бұрын
Great review! Thanks. Have you tried Supermaven? I hear it's really good.