Frage

Is there something similar to java's InvocationHandler in vala. That is, I want to create an instance of an interface or class, giving implementation dynamically. I've read the docs about reflection, but it's quite limited and doesn't say anything about interfaces and abstracts, nor methods.

War es hilfreich?

Lösung

It's not possible to know the class/interface struct at runtime. Limitation inherited from C. On the other hand gobject does not allow specifying more metadata to access class/interface struct fields. The only "reflection" possible with gobject is about properties and the type of an object.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top