I have a spring application, where the function of one of the components is to read multiple files on disk and produce data objects that are then used elsewhere in the app. It will read multiple files and produce multiple data objects.
The design I have been given states that the data object should be created by the spring factory, implimenting an interface.
The easiest way to do this would just have the component aquire/create a beanfactory and use getbean, with the data bean configured as prototype. However that strikes me as poor OO as it has tightly coupled my component to the spring container.
what is the recomended way of solving this? I want to have spring configured data objects, but I want to avoid coupling the component that creates them strongly to the spring framework.
The design I have been given states that the data object should be created by the spring factory, implimenting an interface.
The easiest way to do this would just have the component aquire/create a beanfactory and use getbean, with the data bean configured as prototype. However that strikes me as poor OO as it has tightly coupled my component to the spring container.
what is the recomended way of solving this? I want to have spring configured data objects, but I want to avoid coupling the component that creates them strongly to the spring framework.
Comment