peasoupio / inv

Intertwined network valuables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Class dependencies are not respected

opened this issue · comments

When using classes (and packages) with INV files, classes are parsed then automatically created.
Imagining this scenario (following the order):

package my.classes
inv {
     name "class1-broadcaster"
}

class Class1 {
}
package my.classes
inv {
     name "class1-requirer"
}

class Class2 {
    Class1 myClass1Obj
}

The above example will work ONLY if loaded in that order. Otherwise, if "class1-requirer" is loaded before "class1-broadcaster", it will show a "ClassNotFound" exception.

Is there a way to load the classes matching the dependency ordering or at least separating the parsing and creation steps.

I took a look at "https://stackoverflow.com/questions/25073006/loading-co-dependent-groovy-classes-in-java".
It seems the only way is with the "addUrl" API.
Thus, maybe externalizing classes in a separate library is the solution?