Getting started with libraries
sarah.reichelt at gmail.com
Wed Mar 22 20:33:05 EST 2006
> Recent defences on the list of RunRev's capability with libraries has
> made me realise how much I've missed out by not organising my own
> work with libraries in mind. I would now like to make the move. but
> I'm finding it quite hard to decide how to get started. As in the old
> joke, to get there I shouldn't really have started from here... but
> there it is.
> What I have is a few apps which work and have users etc, and which
> contain common elements. Up to now these common sections were created
> by wholesale copying of stacks and bits of code from a finished app
> to the next one to be developed. I find this is such an awkward
> process that I don't keep all the apps up to date in parallel. For
> example in App 1, I have devised a way for the user to register and
> enter a serial number to get a fully functional version of the
> program; I copied this code into App 2, a process which was pretty
> clumsy in the first place because App 1 and App 2 can't have ANY
> stacks with the same name (unless I open two copies of RunRev, but
> for some reason I'm nervous of this idea). Then as I developed App 2,
> I improved on the stuff I got from App 1. But generally App 1 doesn't
> benefit because it's too much of a hassle to retrofit the improved
> code. Now if I did all this with libraries, I would be much better
> off, since the most up to date version of any library could be
> retrofitted without problems.
While not addressing the libraries issue, I do have a habit for naming
stacks that I find very useful. Each project gets a prefix and all the
stacks in that project have stacksNames starting with that prefix e.g.
a current project is called "Temperature Monitor" so the stacks are
all called "tm..." - tmPrefs, tmAbout, tmHelp etc.
This is really useful when you want more than one project open as
nearly all my projects have a Help stacks, a Prefs stacks and an About
stack among the list.
For your library stacks, again you want to make sure you will have mo
confilcts when loading them in to any of your projects, so I suggest
something similar e.g. gsLibFiles, gsLibGraphics etc. Remember that
you may want to use other peoples' libraries at some stage, so adding
an identifier unique to you is a good idea.
Have a look at the Rev Interoperability Project guidelines
<http://www.revjournal.com/features/rip/index.html> for some more
ideas along these lines.
More information about the Use-livecode