Other Library functions exposure

sorex

Expert
Licensed User
Longtime User
Hello,

I have a lot of classes that are almost or completely identical between projects.

I'm thinking about making small libs of them.

I was wondering how the exposure of functions, variables etc is done by just calling the library name.

A good example is B4XPages where you can access everything by just using B4XPages.xxx from in any class without declaring an object first.
 

sorex

Expert
Licensed User
Longtime User
Is he then using a mixture of a code module and classes?

you can't have variables like activity, panels etc in a code module's Globals so he must store it somewhere else.
 

agraham

Expert
Licensed User
Longtime User
Is he then using a mixture of a code module and classes?
Yes. B4XPages code module basically forwards stuff to B4XPagesManager class. B4XPagesManager implents all the functionality and B4XPages is meant to be the public API of B4XPages exposing only what Erel deems needed.
 

sorex

Expert
Licensed User
Longtime User
Interesting.

I'll do some testing with this.

Thanks for the info.
 

sorex

Expert
Licensed User
Longtime User
Thanks for the hint, Erel.

Needless to say that it was very interesting material.

But it also contains a big mistery (for me atleast).

How on earth did you manage to write the lines that reference the B4XMainPage class when that class didn't even exist yet in your B4Xlibrary file?

Or was that class as dummy added and after compilation removed from the jar/b4xlib files?
 
Top