Software design with rich classes and CDI

0

Good evening. I've been reading a lot about software architecture using rich classes, dependency injection and such. According to what I have read the ideal is the class to receive in the constructor the information it needs and receive dependency injection dependencies. But there's my doubt.

If I instantiate a class manually to pass the values to the object this class is not instantiated by the CDI then it can not resolve the dependencies.

If I leave the class to be instantiated by the CDI I can not pass the values to the class by constructor so I have to fill my setter classes and end the encapsulation.

I thought about creating a class that injects the dependencies by reflection in the constructor and make all my beans inherit this class but honestly I do not find the solution very good ...

Does anyone have a suggestion to give me?

    
asked by anonymous 30.03.2016 / 00:38

0 answers