Re: [Vala] Final / Sealed classes in Vala



On Tue, 2009-09-22 at 06:40 +0200, Marco Trevisan (Treviño) wrote:
Is it possible to define both in VAPIs and in a vala code a class which
can not be extended?

I mean something like "final" does for Java and "sealed" for C#...

It's planned to introduce `sealed' in a future version on both, the
class and the method level.

I think they could be useful for grouping static methods in "virtual
classes" (I mean in a class which name has not a reference in a C
type/structure, but that has just been written for organizing similar
methods) without the risk of methods overriding or of extending a
"virtual" class that has been defined in a VAPI but that is not
available in the relative C code.

However, `sealed' is not meant for "static classes", that concept is not
encouraged in Vala as we support namespace methods.

Jürg




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