Greg Jones wrote:
I guess I'm missing your point. Do you mean support multiple-extends not multiple-implements? Java does support multiple-implements?

Neither, really. It isn't "extends" because the class would not inherit identity (instanceof) from the default implementation classes (only the interfaces that it implements). But unlike implementing multiple interfaces, it does inherit (in a sense) behavior from those classes.

Have you reviewed some common object patterns to see if they will satisfy what you need? You may have to re-model what your thinking but it may be a cleaner 'Java' way of doing it.

I've looked at some. None seem to satisfy the requirement cleanly. The obvious (and simplest) solution is the delgation pattern - encapsulate the default implementation classes and implement each of the interface methods with a call to encapsulated class. It satisfies all the requirements but results in a lot of extra code that could be avoided.

If this is not what you want, and your are talking about delegates then your are stuck thinking outside the 'Java' box. .Net has this
capability but I don't think Java has it in the JDK 1.5.

It would be similar to delegates. But as usual, the M$ implementation of just delegating a single method signature is very procedural. Whereas my vision seems very OO (at least to me).

C


-- ------------------------------------------------------------------------- Chris Merrill | http://www.webperformanceinc.com Web Performance Inc.

Website Load Testing and Stress Testing Software
-------------------------------------------------------------------------

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to