Why not put the Services Subs() whenever possible, into Code modules and have only global variables and bare bones Subs() in the Services? A lot of my code is reusable so I prefer using Code modules.
I'd really like to see a sample app that uses your approach to see it working for myself. Unless the app is interacting with data outside of the app, like pulling down data from the web, I don't see the need to be running most GUI apps in the background. Maybe I'm missing something. A sample app would certainly clear things up.
So the way it sounds to me, there´s nothing else than a better structure for the coders own overview, which justifies code being executed in an activity module.
And for that reason, it may be that I´ll leave subs which are pure math in the activity - after all it may be helpful to not have everything under the same umbrella. On the other hand, many of these "pure math" activities relate to things that are happening on the network, and they should not wait for execution till the application is in the foreground.
I made a simple example for myself to see how it works, that´ll start the service module, which starts a timer that after 5 secs will call one sub in the main activity in order to make a msgbox popup. This is so I had time to put the app in the background and see what happens with such a call to a msgbox when it´s not in the foreground.
The result was fine: It queues the msgbox so that it´ll show as soon as the app is back in the foreground.
After the messagebox, the first timer stops, and another timer starts which logs the datetime.now every second, within the service module - to see if this would be interrupted by the app being in the background. This worked fine, the logging just keeps going.
So in the main activity there´s only the call to service and a sub with the msgbox. The rest is in the service module. I´m not sure if you really want to see this?
And thanks to Erel for clarifying further.