r/java • u/Patresss • Aug 12 '21
There is no magic in Spring, I wrote my own (very simplified) framework from scratch to show it
Hi, I often hear that Spring is some kind of magic and there is no way to know how it works underneath. Probably many people know why annotations like @Transactional do not work in private methods and when called from the same bean. However, probably not everyone knows why this happens.
That is why I decided to write my own framework based on Spring from scratch. If you are a beginner I recommend you clone the repository, open a specific step as a package e.g. code - step 1, and read the readme at the same time with a description of the step.
If you are more advanced or you are only interested in the end result then everything is in step 7.
The framework includes dependency injection, @Transactional, and @Cacheable annotations.
The project: https://github.com/Patresss/Java-Own-Framework---step-by-step