From: "Jörg W Mittag" Date: 2008-01-25T21:29:58+09:00 Subject: Re: composition/inheritance/subclassing standard lib classes Hi! Sorry for the late reply. Paul Nulty wrote: >> An alternate approach if you don't want a specialized Domain Object >> but rather a specialized generic Collection is described here: >> . >> The basic idea is: copy the Array Class (remember, Classes are just >> Objects, too!), remove the methods that you don't want, et voil�, >> there is a List or a Stack or a Queue which isn't a subclass of Array >> but actually "inherits" its behaviour. > In this link that you posted, i don't understand the Array.extract > syntax? where is this "extract" method coming from? It's a method that the author of said article wrote to implement exactly what I described: copying a class and deleting all methods not in the "extract" list. (The method actually has a couple of more tricks up its sleeve.) The implementation is actually linked in the article: . jwm