From: Kal A. <ka...@te...> - 2001-10-25 08:41:14
|
At 09:38 25/10/2001 +0200, Gerd Mueller wrote: > > 2) Added the VariantContainer interface. This is the interface for an > > object which contains a list of child Variants. It is a subclass of > > ScopedObject and a superclass of both Variant and BaseName. It provides > the > > operations getVariants(), setVariants() and addVariant(). Also, Variant > > will return a Variant Container from its getParent() method. > >Where is this interface used ? To model names of topics ? Essentially, yes. The issue that this interface addresses is that Variants can be nested inside other Variants. This means that a Variant might be a child of either a BaseName or a Variant. So two things need to happen: 1) Both BaseName and Variant must have methods to add/remove/update the list of child Variants 2) The Variant.getParent() method might return either a Variant or a BaseName Adding this interface encapsulates the common functionality of (1), and enables getParent() to return something slightly more type-safe than TopicMapObject. Cheers, Kal |