Timeline for "Worker object pool" pattern?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 23, 2011 at 11:53 | comment | added | Valery | @PéterTörök You are right, the object pool is correct answer for this question. | |
Nov 23, 2011 at 11:43 | comment | added | Péter Török | @mikalai, the "slight modifications" would turn your Flyweight into a different pattern - see my answer for details. The implementation of these two patterns may look slightly similar, but their intent and purpose is rather different. | |
Nov 23, 2011 at 11:41 | comment | added | Péter Török | @mikalai, a FlyweightFactory gives you always the same physical object for the same kind of query (e.g. for the "Euro" glyph in a word processor), but different objects for a different kind of query. Thus all Euro glyphs in the text share the exact same (usually immutable) state. Whereas an Object Pool serves you one random available object, and you don't care which one, because they have no identity, and their state may be important only during processing a request - but you definitely DON'T want them to share their state with each other. | |
Nov 23, 2011 at 11:33 | comment | added | mikalai | @PéterTörök - why not? With slight modification of course.. Wouldn't you propose some other way? | |
Nov 23, 2011 at 11:27 | comment | added | Péter Török | No, Flyweight is definitely NOT meant (nor used) to implement object / thread pools. Just read the referred Wikipedia article carefully. | |
Nov 23, 2011 at 11:13 | comment | added | mikalai | Right, pattern matches in sense of persisting processor objects. And thanks for operations hint. | |
Nov 23, 2011 at 10:49 | history | answered | Valery | CC BY-SA 3.0 |