Originally posted by Ilja Preuss:
What exactly do you mean by "a lot"? How big are they? And how long will they live?
Java is very good at managing a lot of small, short lived objects. I would worry that the use of a object pool could be premature, unnecessarily complicating the design. Could you reproduce a memory issue in tests?
Originally posted by akilan irudaya raja:
Your are not going to implement message processor. But you need to
design the intelligence which selects the appropriate MessageProcessor, Is it so?
Originally posted by Chris Nappin:
Can you elaborate on your requirements?
Do you have to consider threading? Does the pool need to be dynamic?
If threading is not an issue then the best way to minimise memory use is to use the singleton pattern. However whatever solution you decide to use can be hidden behind a factory method so you can change it in the future if needed.
Originally posted by Paul Sturrock:
"Message Driven POJO"?
Are you saying you need to implement something using JMS? If so, what?