11 ms·
I've solved this in past Java/Spring projects by having two public constructors, one default and one that takes all the "organs". The default constructor just d
by BorgHunter 12y ago
I've solved this in past Java/Spring projects by having two public constructors, one default and one that takes all the "organs". The default constructor just delegates to the "provide me with organs" constructor but creates all the factories and providers and such itself. This doesn't work if you have long chains of singleton objects that get passed around to a lot of classes, but it works well for simpler cases.