P
P
parkito2017-09-16 14:52:08
Java
parkito, 2017-09-16 14:52:08

How to organize Hibernate CRUD architecture without spring?

Hello. Help, please, to solve a problem.
I want to write an MVC application without using spring. The question arises how to control object instances. It is clear that you need to implement IoC. But all the methods that I know do not suit me very much.
1) The first approach is stupid to create classes where they are needed. Bad - this is not IOC
2) Instead of creating instances every time - make them static once. The idea is also not brilliant.
3) Make everything on singletons. I do not like.
4) D.I. Pattern. Until he stopped.
If you develop an application without any springs and JSR330, is DI the best approach to resolve dependencies? Maybe there is something else that I don't know?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question