Modular/part script
#7

Don't use that method however, otherwise your main script will be dependent on your module's data and it can be mixed very easily.

Each module should be completely dependent upon themselves. In other words, if I were to run that module with another script (or by itself entirely with little boilerplate code) it should run. So, each module should contain hooked functions to handle triggers (callbacks). Every internal function and data (as should be with any include) should be declared as static. There should be an API to communicate between the module and your main script, i.e. functions. These functions should include means of getting the private (static) data from the file to the other (getter/setter functions).

I was debating writing a full mode taking use of modules to release so people better understood the design process. May do so now..
Reply


Messages In This Thread
Modular/part script - by SilencedPistol - 06.11.2013, 07:14
Re: Modular/part script - by SilencedPistol - 12.11.2013, 00:54
Re: Modular/part script - by Akira297 - 12.11.2013, 01:06
Re: Modular/part script - by SilencedPistol - 12.11.2013, 01:07
Re: Modular/part script - by Akira297 - 12.11.2013, 01:13
Re: Modular/part script - by cessil - 12.11.2013, 01:28
Re: Modular/part script - by Bakr - 12.11.2013, 01:41
Re: Modular/part script - by Pottus - 12.11.2013, 02:47
Re: Modular/part script - by SuperViper - 12.11.2013, 04:31
Re: Modular/part script - by Ada32 - 12.11.2013, 04:32

Forum Jump:


Users browsing this thread: 1 Guest(s)