Page 1 of 1

Scripting Style - Backscript or start using

Posted: Sat Mar 04, 2017 9:47 am
by Simon Knight
Hi,
I am in the process of refactoring one of my projects and wish to reduce the number of handlers in my main stack to aid clarity.

A number of handlers deal with a single aspect (report generation) so I have moved these to a new sub-stack. I have use a start using mysubstack command in the main stack to enable the use of the handlers in the sub-script and all is well.

However, I wonder if I should consider other methods such as putting the scripts into the backscript. What are the advantages/disadvantages of each method? What do you favour?

Skids

Re: Scripting Style - Backscript or start using

Posted: Sat Mar 04, 2017 10:30 am
by jmburnod
Hi Simon,
I have experimented the inverse.
Mainstack contains handlers which uses by substacks or stacks.
I choose this way to allows adding stacks from a server.

Advantage
Modular approach and flexibility

Disadvantages
Prohibited for AppleStore (we can't dowload code and Apple consider stacks as code)

Best regards
Jean-Marc

Re: Scripting Style - Backscript or start using

Posted: Sat Mar 04, 2017 10:49 am
by Ledigimate
Hmm... thanks J-M, I was planning to make my app update itself by downloading stacks from a server. You've just saved me a lot of future frustration. But it does make sense, though. Apple cannot approve apps which can add unapproved features to itself.

Re: Scripting Style - Backscript or start using

Posted: Sat Mar 04, 2017 4:06 pm
by Simon Knight
Also thanks J-M,

I had not thought of arranging code that way but I can see that it has its uses as long as the app is not going on the Apple App store.

Simon

Re: Scripting Style - Backscript or start using

Posted: Sat Mar 04, 2017 5:48 pm
by Mikey
This is not completely true. There are plenty of apps that download updates remotely. The first one that comes to mind is one that I play all the time, plants vs. zombies.

Re: Scripting Style - Backscript or start using

Posted: Sun Mar 05, 2017 2:29 am
by jmburnod
Hi Mickey,
There are plenty of apps that download updates remotely
Yes, You're right for update app but not for import stacks
Jean-Marc