From: Robert Klemme Date: 2008-04-25T06:25:03+09:00 Subject: Re: inverse OOP On 24.04.2008 12:15, Eleanor McHugh wrote: > On 24 Apr 2008, at 10:40, Martin Vales wrote: >> I have always had a doubt about OOP. >> Usually we have a parent and several child, but what happen if we need >> the inverse system. for example DBI/DBD APIs.?? >> >> I need build map proyections and i want and intermediate API for all >> proyections clases. What exactly do you mean by "intermediate"? Do you mean that all projections should have the same interface? For that you do not need inheritance at all - at least in Ruby. Or do you rather mean that they share behavior (implementation)? >> All map proyections have the same methods (geodetic_to_projected and >> projected_to_geodetic) > > Then define either a projection class from which they all inherit, or > a projection module which they all include. Nice reading from you again, Ellie. :-) I was going to also suggest the module approach. But I do wonder why Martin chose to call it "inverse OOP". It seems the more appropriate term would be "multiple inheritance" or am I missing something? Cheers robert