From: <pe...@cs...> - 2003-12-02 09:32:14
|
Hi Tim, I am cc'ing czt-devel since other developers might be interested in that topic as well. Tim wrote: > One other question: is it possible to have the OzFactory interface and > it's implementation inherit from ZFactory (and ZFactoryImpl)? I may be > missing something that makes this not very sensible from a design point > of view, but from a user view I think that this would be better. We (Mark and I) decided to do it this way since it is not guaranteed that Z extensions are designed in a tree like structure that you need for inheritance hierarchies (without multiple inheritance). For instance, currently there is a zpatt and an oz package. We could inherit ZpattFactory and OzFactory from ZFactory, but what should we do if we want to provide a ZpattOz package which uses elements from both packages (zpatt and oz)? The ZpattOzFactory cannot extend OzFactory and ZpattFactory since multiple inheritance is not possible in Java. In order to overcome the inconvenience of having multiple factory classes, I want to provide a Delegator (a proxy class which can implement several interfaces). You can have a look at net.sourceforge.czt.util.Delegator and try whether it works. There is also a junit test in corejava/tests/net/sourceforge/ctz/util/DelegatorTest.java which should show how the Delegator class can be used. I am going to provide an example that uses the Delegator class as soon as possible. Any comments are welcome. We are not sure whether having a ZpattOz package is possible at all. Perhaps we are trying to be too general but achieve nothing from this approach? Petra |