|
|
|
|
|
by cygned
1736 days ago
|
|
What I am referring to with factories in particular is that I can have a bean injected in Spring automagically using an annotation, have an interface and an implementation behind it. Now, I can go ahead and make the concrete implementation dependent on configuration, e.g. by providing multiple implementations annotating them with a condition that is evaluated using the application configuration. I can also switch to a factory method that creates and sets up the concrete implementation for the interface, I have not to change any place in the application that is using that piece, though. The same should be possible in Go with reflect and an IoC container, but I am not sure if there's a solid implementation for that out there. |
|