I've always been confused by this. Why does Servoy use the scope of the project in reverse of how Modules are linked together?
For example, you have your Main Solution right? That Main Solution points to modules. These modules can point to other modules. From the 'root' of the solution, this linking of modules is 'forward' from the root. Intuitively, the assumption would be this is also how the actual scope of the code works too.
When I talk about 'scope' I'm specifically referring to being able to call a function or reference data from another module's form or scope within another module. Essentially 'seeing' other modules.
But the relations, usually used with Parent / Child metaphor, is a bit more complicated.
Example 1 - SCOPE LINK
(see below)
The Parent Module sees everything the Child Module has. But also, the scopes origin/root is shared with the Child Module.
With this idea, the Solution or Module0 would be the 'global' scope so to speak as every other module is under them.
Every Module in this case would be able to see and use what Module0 or the Solution has with Forms and Scopes.
This means, Module1 can see and use everything from Module0 and the Solution, but not Module2 or Module3.
Module4 would be a 'sub' module under Module1 as well. So despite Module4 having the global module of Module0, it wouldn't be able to see Module5 or Module 6.
Module7 and Module8 would be at the end of the line. This would be kind of a double 'global' scope in a way but only in one direction.
To put it simply, the Parent can see and use everything the Child has. AND, the Child can see and use everything the Parent has.
However, this isn't how Servoy actually works with scopes despite how these are linked.
EXAMPLE 2 - SERVOY SCOPE
(see below)
This is how Servoy's scope works. While the Parent Module can see what the Child Module has.. the scope isn't shared. So rather than the root / origin being the 'global' it's the end of the linking itself.
So then, Module8 and Module 7 are the 'global' modules. Meaning, all the Modules will be able to see and use them...
But, the Solution and Module0 become the 'end' point... Meaning they will see and use everything. WHich is strange because the Solution and Module0 are the main 'Parents' of all the links.
To put simply, the Parent can see and use everything the Child has.... But the Child can't see or use anything the Parent has.
THE PROBLEM
Because the linking of Parent and Child modules are 'backwards', this creates some weird problems.
For example, despite Module8 supposedly being the global module in EXAMPLE 2 / How Servoy Currently Works .... It can't actually SEE anything. It is only referenced.
Likewise, the Solution can see and use everything.... but why what would be the point of this when most of the programming is going to be happening in the 'Child' modules themselves. And if the Child modules can't see the Solution... Then the Solution is basically useless.
THE SOLUTION
Make the SOLUTION the ORIGIN / ROOT of all scopes. EXAMPLE 1 just makes more sense.
Not only is the Solution the 'Super Parent' that can see all of it's Child Modules, but all of it's Child Modules can use the shared global scope that is created 'forward'.
Plus, it's easier to split that 'global' scope up by just connecting some other modules to the Solution and basically creating new organizational scopes from that.
HELP?
Is there a reason why Servoy uses an inferior way of scoping the Solution such that the Solution is not the origin/root/global scope?
Or if there's a way of turning the Solution into the root/global?
[Example 1 - SCOPE LINK]
[EXAMPLE 2 - SERVOY SCOPE]