Re: [Vala] protected classes



Juerg Billeter wrote:
On Tue, March 4, 2008 17:16, Vlad Grecescu wrote:
  
Currently Vala uses
- 'public' classes for classes that end up in the headers /and/ in the
library (if you're building one)
- 'private' classes for classes that don't end up in neither headers
/nor/ in the created libraries.
    

The idea is that 'private' (or 'internal') classes will end up in private
header files. Top-level classes that are not in any header files (as the
situation is right now for 'private' classes) don't make any sense, as we
don't want to support file-level accessibility in Vala.

Juerg

  
Ok, allow me to rephrase the idea - since the 'headers' talk was misleading.

There will be libraries made with Vala. Those libraries will export all function symbols (thus, 'classes') by default, and will install all .h files by default.
The libraries' authors will want to restrict the usage of the library to a certain API (ABI).

This can currently be accomplished by providing a list of symbols for libtool - with either -export-symbols or -export-symbols-regex.
The 'private' headers will be stripped from the installation by specifying noinst_ .
Also, API documentation will be generated with either gtk-doc or valadoc (dunno nothing about them)


How could the library authors specify in a unique/simple way the classes they don't want part of the API?
This is where I thought 'protected classes' would be an interesting annotation for this.

It doesn't clash with an existing other meaning in, say, Java or C# (although the lack of them causes pain in Java world - which they are trying to solve through JSR 277: "... The [jar] metadata would also include an export list to restrict resources from being exposed outside the module unintentionally..")

I am just trying to propose an early solution to this (future) problem, although it seems complicated.
Vala could generate symbol files that the integration with autotools will automatically use with the libtool targets.


Thanks for having time to read this:D
-- 
Vlad 


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