Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoOpAccountLock bean is not clear #18

Closed
novicedev7291 opened this issue Oct 30, 2020 · 2 comments
Closed

NoOpAccountLock bean is not clear #18

novicedev7291 opened this issue Oct 30, 2020 · 2 comments

Comments

@novicedev7291
Copy link

Hi Tom,

I read your book and explore the repository associated with it and I must say my long search for clean architecture implementation with spring and java, have reached to some conclusion now. It helped me understand few misconception about dependency inversion and SOLID principles and I am still trying to embrace it for large enterprise project.

However, I am not able to understand the lock and release part in code, although I do understand it in context of business domain but not sure if you have just demonstrated it with dummy singleton bean or is it real implementation of locking behaviour in this context?

Thanks a lot for sharing your thoughts with a book and all the resources online.

@thombergs
Copy link
Owner

Hi @novicedev7291,

you're right, the lock is just a solution so that we can't make two transactions on the same account at the same time.

I was too lazy to implement a real version of the account lock, but in a real application, the AccountLock interface would have to be implemented in a way that it locks an account across multiple nodes of the application. The easiest way would probably be to use a database lock if we're using a SQL database.

@novicedev7291
Copy link
Author

Thanks for explaining this, Tom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants