"Hyman Rosen" a �crit dans le message news: fXw19.29303$NX5.1749@nwrddc02.gnilink.net... > Jean-Pierre Rosen wrote: > > It provides a design pattern for providing all the functionnality of Java interfaces > > Including cross-casting? > > That is, in Java (or C++), if I have class C implements I1, I2 > and I have an I1 reference, I can try casting the I1 to an I2, > and if the reference is actually to a C object, the cast works. > > The attempts to simulate MI in Ada by using access discriminants > don't handle this, as far as I know. > Yes. Or more exactly, the design pattern provides functions that allow you to get an I1 or I2 view for a C object, and to go back from an I1 or I2 view back to the original C object. And you are correct that this is not obvious to achieve. That's what prompted me to make a paper of it! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr