Currently I have a webapp with 6 windows. This is due to grow to somewhere around 10-12 windows by the time the app is complete. Each window has at least 10 gadgets, the more complex ones have anything up to 40-60.
Because SB is not object oriented, I cannot use polymorphism to name objects the same thing across windows. So I cannot for example use Window1.CloseButton or Window1.CloseButton.OnClicked()
Instead, I have, for example:
#CONTROL_Main_CloseButton on the main form, #CONTROL_Search_CloseButton on the search form, etc etc.
This is becoming very unwieldy.
One approach I was thinking of was namespacing each window in its own module. However, each of my windows' code needs access to a global "registry" Map and some other global variables and constants. Now I see that modules cannot access the global scope (so it is not really global, merely "mostly-global", as Miracle Max might say

Is this the way others are doing it or is there some better way to structure larger apps?
Other than controls/gadgets, I also prefix my windows with #WINDOW_, so for example #WINDOW_Main, #WINDOW_Search,. and then each Proc/Function is for example: Main_Open(), Main_GetLicenseeData(), Main_Close(), Search_Open(), Search_FetchResults() etc etc
Modules which allow me to namespace procs and hide private variables and code from the outside world seem attractive. My concern is that reading many articles on the web suggest that using modules in PB/SB quickly become unwieldy.
Any thoughts? If I am going to refactor, I'd rather do it now than when my app is complete
