------art_8392_12248168.1196658121321
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks Dejan. I will try it out.

Kiran.


On Dec 2, 2007 11:05 PM, Dejan Dimic <dejan.dimic / gmail.com> wrote:

> On Dec 2, 11:02 am, SunRaySon <sunray... / gmail.com> wrote:
> > Note:  parts of this message were removed by the gateway to make it a
> legal Usenet post.
> >
> > Hi,
> >
> > I would like to simulate something like friend class or method in Ruby;
> From
> > the pickaxe documentation I could not figure out if there is one
> directly
> > available or not.
> >
> > I do understand that having friend classes and functions is not good
> > practice.
> >
> > Regards,
> > Kiran.
>
> Friend Functions and Friend Classes are often useful for one class to
> see the private variables of another class, even though these
> variables should probably not be made part of the public interface
> that the class supports.
>
> Friend function or friend classes are one of most dangerous
> construction. From my experience mostly because programmers tend to
> misuse it. I do not want to make this an academic issue so to make
> this short: my advice is do not use friend class as a construction in
> you code especially if you try to port some C++ algorithm even if that
> seams to look like an easy thing to do.
>
> Depending on particular reason, why do you think you have to use the
> friend class, I will most probably consider using observer and/or
> visitor pattern in stand.
>
>

------art_8392_12248168.1196658121321--