Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!usc!sdd.hp.com!elroy.jpl.nasa.gov!ncar!gatech!prism!prism.gatech.EDU!gt0460d From: gt0460d@prism.gatech.EDU (DSOUZA,ROSARIO JOHN) Newsgroups: comp.lang.eiffel Subject: a problem in programming with Eiffel Message-ID: <20022@hydra.gatech.EDU> Date: 21 Jan 91 23:02:12 GMT Sender: gt0460d@prism.gatech.EDU Organization: Georgia Institute of Technology Lines: 27 I have a curious problem. I am writing an application in Eiffel that makes use of the graphics library. In particular, I need to use objects that are similar to the class COMPLEX_FIG in the library, yet a little different from it. My class is similar in the sense that it is to have a list of figures and the whole list has to behave like a figure. But it is different because the figures in the list are really going to be a special type of figure that is a descendant of class FIGURE. At first I thought that I could make my class a descendent of the class COMPLEX_FIG and proceed from there. This is the most natural solution. However, it turns out that COMPLEX_FIG inherits from FIG and LINKED_LIST, and the generic parameter of the linked list is FIGURE. This causes a problem because I need the generic parameter to be something that is capable of responding to feature calls of my special figure. This seemingly cannot be done because the generic parameter is hardwired, so to speak, to the class FIGURE. My question is: short of duplicating the code for COMPLEX_FIG with the generic parameter of the inherited linked list now as my special figure, is there any other better way to solve the problem? I suspect that the problem is not just a matter of good library design, but also a problem of language design. Could someone enlighten me? ..Ross D'Souza Georgia Tech. ross@cc.gatech.edu