There is any open source generic bean container?
Let me explain the scenario.
I am working in a Java EE project, and we are using a Swing client. We are using JsonJSON to serialize objects. In client side we can recievereceive a JsonJSON message representing a List. Sometimes some A instances can be the same object, but actually for 2 instances of A that are the same object we construct 2 beans that are equals between them but aren't the same instance. This give us someseveral problems: memory overhead, changes made to one instance don't update the other one, ...
memory overhead, changes made to one instance don't update the other one, ...
What iI think we need is a container that can make instance wiring, when a new instance is contructedconstructed we should check if it already exist in the container, in that case assign it instead the constructed one. SomethigSomething like JPA L2 cache, but in client side.
Is there any implementation about it? Or
Or maybe i should use another approach?