Article View: borland.public.jbuilder.java.language
Article #18338Re: Strategy for Object Reusing
From: William Yu
Date: Thu, 09 Jul 1998 00:00
Date: Thu, 09 Jul 1998 00:00
24 lines
1736 bytes
1736 bytes
Gerry Mantha wrote: > > > 3. I'd make it an interface so you don't have to inherit directly from > >ObjectPool. > > What's wrong with inheriting from ObjectPool? Isn't that what abstract > classes are for? The common work is in the abstract class... Perhaps I'm > missing your point here too. Let's say you want to create AWT components that are reusable. You can't inherit directly from ObjectPool; otherwise, the components would no longer be usable. > I'm missing you here too I think. First, with an object pool you don't scan > or iterate looking for type matches. There exists a separate object pool > for each type. Any iteration is done for validation purposes (for > connection reuse and such only). I think I was going beyond the idea of simply inheriting reuse behaviors. Let's say you want to reuse a whole wide range of objects from AWT components to Date/Font/Color/etc. but you don't want to write a wrapper class for everything. Rather, have a static recycler class that anybody could use. (I've been looking this left and right and it may be unfeasible.)
Technical Details
Message-ID:
<35A51F85.7783B76E@Bigfoot.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<359CBFDC.DE310722@Bigfoot.com> <6njkh0$9sj10@forums.borland.com> <35A03942.7B8BBB35@Bigfoot.com> <6nv0og$hto16@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,463db4f771a2408f X-Google-Attributes: gidf74b3,public From: William Yu <William_Yu@Bigfoot.com> Subject: Re: Strategy for Object Reusing Date: 1998/07/09 Message-ID: <35A51F85.7783B76E@Bigfoot.com> X-Deja-AN: 369969461 Content-Transfer-Encoding: 7bit References: <359CBFDC.DE310722@Bigfoot.com> <6njkh0$9sj10@forums.borland.com> <35A03942.7B8BBB35@Bigfoot.com> <6nv0og$hto16@forums.borland.com> Content-Type: text/plain; charset=us-ascii Organization: American All-Risk Group (AARG) Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language