Ticket #4 (new enhancement)
Factories + poolers
| Reported by: | jordi | Owned by: | nobody |
|---|---|---|---|
| Priority: | minor | Milestone: | oncoming |
| Component: | planetsim | Version: | PlanetSim 3 |
| Keywords: | factories poolers | Cc: |
Description
Enable that each Factory could become at the same time a Pool of that kind of objects. This schema enables object reutilization and avoid the Garbage Collector.
The basic idea is that each built object by a factory must implement (by inheriting from a superclass or so on) that when the Object.finalize() methos would be invoked, this cause that this free object returns to the Pool of the Factory.
So, when Factory have to build a new instance, it first checks its own Pool for any existing instance. In other case, build (i.e. builds a new instance) of the required class.
Change History
Note: See
TracTickets for help on using
tickets.
