Add fields from stack in data directory to standalone

Chipp Walters chipp at chipp.com
Sun Dec 5 16:49:26 EST 2004


Hi Bob,

I would take a different approach than the one Klaus recommends. I would 
separate my data completely from the presentation and business logic of 
the application (the way you currently are thinking).

If the data was basically text based (no images, movies, sounds) then I 
may consider storing it in either a text or XML file (or customTagged 
file format I build myself). Of course, if there was a LOT of data, I 
might consider using SQLlite or another DBase.

If the data included images, movies and/or sounds, then I would consider 
storing it in a stack...one that the user would never see. I don't know 
how Rob Cozens Seredipity Library works, but I suspect this is how he 
stores his data -- you might want to take a look at it.

Then, I would keep all business logic and the presentation (GUI) stuff 
in a standalone which cannot be written to. I would move data in and out 
of the standalone stack.

I don't like mixing content and business logic/Interface, especially 
when you'll be adding/deleting from stacks. It's one of my pet peeves 
about Rev- and I suspect one of the major support issues with the IDE: 
the fact that it actually saves itself..including business logic and any 
bugs or bad logic which may have been introduced during the many hours 
of a users programming. I digress.

So, my basic mantra is to never 'save' stacks other than data stacks. 
And never mix interface and business logic with changing data stacks.

hope this doesn't end up even confusing you more;-)

best,

Chipp

Bob Hartley wrote:

> I've not been rev'd up for a while now (new job kept me away). I was 
> looking at the threads regarding saving database data in a file.
> I'm just trying to get my head roung the grand plan before I do down the 
> wrong path like the last time (see database tutorial thread)
> 
> Some suggested that you could have a data directory with stack in it and 
> have the standalone reference this... Eureka I thought!!!
> 
> OK tall me if I'm right on this please.
> 
> Can I have a premade database eg bob1 and make a standalone. Then have a 
> stack file eg baddresstemplate.rev and  have the data put in a .rev fiel.
> 
> Would it be something liek this (note: the syntax is made up)......
> On mouse up (on a button called new entry)
> Copy addresstemplate.rev to directory C:\Bobdata
>  put the text of field "bobs address" into field1 of card1 of stack 
> addresstemplate.rev
> end mouse up


More information about the use-livecode mailing list