Re: [Vala] Friend class?



Hello,
I think friend class should not supported in vala.
If you use them that shows that code should be redisgned.
In c# and other programming language there is a programming paradigm for explicit or hidden interfaces.
I think that would be a better approuch.
In c# it is also possible to define internal code (methods, types and classes).
This feature is nice but not very use full when somebody want to or should use your code.

Regards
Uwe


2009/3/11 Jürg Billeter <j bitron ch>
On Tue, 2009-03-10 at 23:10 -0400, Yu Feng wrote:
> On Tue, 2009-03-10 at 08:07 +0100, Jürg Billeter wrote:
> > On Mon, 2009-03-09 at 20:36 -0400, Yu Feng wrote:
> > > Dear list,
> > >
> > > Are friend classes available in VALA? If not, are there any particular
> > > reason against it, and are there any alternatives for friend classes?
> >
> > There is no plan to support friend classes in Vala. The `internal'
> > modifier is as close as it gets, it restricts access to the class/member
> > to the current library/application. If this is not fine-grained enough,
> > maybe you should consider moving some code into a separate library (can
> > also be a libtool convenience library in case you're using autotools).
> >
>
> Can a property setting be internal? I tried to added to a setter and
> apparently nothing happened.

Yes, this should be supported. However, internal header declarations
will only vanish from the public header files once the header rework[1]
has been completed.

Jürg

[1] http://mail.gnome.org/archives/vala-list/2009-January/msg00058.html


_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



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