Re: Overload implementation



Hi Franck,

I would solve it by having 

GMBoundary GMObject.boundary();
GMBoundary GMPrimitive.boundary();
GMBoundary GMCurve.boundary();

...for clients that need to treat the objects polymorphically, and
also add specific operations for those who know how to deal with the
specific GMBoundary subtypes:

GMCurveBoundary GMCurve.curveBoundary();


Or, if you are using a dynamic interface discovery mechanism like
com/bonobo queryInterface(), your clients could get the ref to
GMBoundary, and then query if it supports the GMCurveBoundary
interface.  (sort of like dynamic_cast in c++).

I like the 1st solution best though.

Hope this helps,

Phil



Franck Martin writes:
 > I know overload of methods is not allowed in CORBA, but how would you solve this
 > problem with orbit?
 > 
 > basicaly I would like to have
 > 
 > GMBoundary GMObject.boundary();
 > GMPrimitiveBoundary GMPrimitive.boundary();
 > GMCurveBoundary GMCurve.boundary();
 > 
 > With
 > 
 > interface GMObject;
 > interface GMPrimtive:GMObject;
 > interface GMCurve:GMObject;
 > 
 > Cheers.
 > 
 > 
 > _______________________________________________
 > orbit-list mailing list
 > orbit-list gnome org
 > http://mail.gnome.org/mailman/listinfo/orbit-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]