Strategy to construct a Stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 11
- Joined: Mon Oct 31, 2011 3:46 pm
- Location: Edinburgh, Scotland
- Contact:
Strategy to construct a Stack
I am trying to plan what strategy I should use to create a sort of Database that keeps records of the buildings we have built. Each building would have basic information like Client, Cost, Number of Storeys etc.
My first thoughts are the user would create a new card based on which building type they are going to record.
The Stack would have a script that would create a new card using a "template script" to make a card that suits each building type.
The Database would have to be viewable and editable by up to 10 users. This last bit I have no idea how Livecode deals with networking different users or even if that is a problem. Hence why I am wondering if this is even the right way to proceed and I should be looking at using some kind of proper database eg SQL ?
Thanks in advance for any advice
Graeme
My first thoughts are the user would create a new card based on which building type they are going to record.
The Stack would have a script that would create a new card using a "template script" to make a card that suits each building type.
The Database would have to be viewable and editable by up to 10 users. This last bit I have no idea how Livecode deals with networking different users or even if that is a problem. Hence why I am wondering if this is even the right way to proceed and I should be looking at using some kind of proper database eg SQL ?
Thanks in advance for any advice
Graeme
IMac MacOSX 10.13
Livecode 9.0.0 Build 15103
Livecode 9.0.0 Build 15103
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Strategy to construct a Stack
Will the system be used exclusively on your local network, or will any users connect over the Internet?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 6
- Joined: Sun Jul 15, 2018 9:30 pm
- Location: Edinburgh, Scotland
Re: Strategy to construct a Stack
It will be on our local area network
Thanks
Thanks
Graeme
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Strategy to construct a Stack
Hi and welcome to the forum.
I would suggest that instead of creating cards on the fly, you have a card for each building type pre-created. Then, on your home cards, you could have buttons or some other means for the user to navigate to the desired building type card. I would also recommend that you have a column for the building type in your DB, then use this column data to navigate to the proper building type card in your stack and populate the rest fo the building data on the card from information in your DB.
I would suggest that instead of creating cards on the fly, you have a card for each building type pre-created. Then, on your home cards, you could have buttons or some other means for the user to navigate to the desired building type card. I would also recommend that you have a column for the building type in your DB, then use this column data to navigate to the proper building type card in your stack and populate the rest fo the building data on the card from information in your DB.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- Posts: 6
- Joined: Sun Jul 15, 2018 9:30 pm
- Location: Edinburgh, Scotland
Re: Strategy to construct a Stack
I was hoping not to have to retrieve data from a database but merely create cards which retain the data. Not every building even when split by type will be the same and so retrieving data from a database may get complex or I would have to have separate databases for each building type but even then a 1500 pupil school isn’t the same as a small nursery for 100 children but they are both educational buildings
Graeme
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Strategy to construct a Stack
You could have one DB with a table for each building type. A DB approach would allow for the 10 users you said you wanted. Having 10 users access a single LC stack over a network would cause you a lot more trouble than setting ups a well thought out and designer DB. The DB would also be much faster especially if you have 500 buildings top track. Just my thoughts.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- Posts: 6
- Joined: Sun Jul 15, 2018 9:30 pm
- Location: Edinburgh, Scotland
Re: Strategy to construct a Stack
Ah thanks for that info. Am I right in saying I would need to run a database server to host the databases? If so what kind of app would I need?
Graeme
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
Mac iMac 2012
MacOS 10-15
Livecode 9_6_4
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Strategy to construct a Stack
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Strategy to construct a Stack
The issue is record locking. LC server probably (I don't use it) finds a way to manage that.
I think that you should create new cards each time a new building is added, from a template. Then you just clone as you go. This is simple to do.
Craig Newman
I think that you should create new cards each time a new building is added, from a template. Then you just clone as you go. This is simple to do.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 11
- Joined: Mon Oct 31, 2011 3:46 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Strategy to construct a Stack
Cheers for that, I think as a starting point the way you describe is the way I am going to go for now just to get some of our more recent Projects catalogued and me a bit more up to speed with LiveCode
Ultimately it will have to become a proper database as over the 20 or so years we have archived 360 Projects. So I'm thinking an SQL database for each Building Type with a corresponding Stack that calls the info in.
Thanks again
Ultimately it will have to become a proper database as over the 20 or so years we have archived 360 Projects. So I'm thinking an SQL database for each Building Type with a corresponding Stack that calls the info in.
Thanks again
IMac MacOSX 10.13
Livecode 9.0.0 Build 15103
Livecode 9.0.0 Build 15103
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Strategy to construct a Stack
Another approach is to store the building info in an array if you don't need all the functionality of a database. Arrays are very fast and 360 buildings isn't a very large number. The array can be stored in the stack itself or in an external file. But the decision depends a lot on how you'll use the data and what it contains.
Do you need to look up only the building name, or will you need to search by more specific criteria? Complex searches are better with a database. Searches by a single key work well with arrays or even just card-based field data. Using the stack itself as storage is very doable with only 360 cards.
Will each building have the same types of information stored? If so, a single card that loads the fields dynamically works well. If each building has unique information then different cards with permanent data would be a good choice.
Do you need to look up only the building name, or will you need to search by more specific criteria? Complex searches are better with a database. Searches by a single key work well with arrays or even just card-based field data. Using the stack itself as storage is very doable with only 360 cards.
Will each building have the same types of information stored? If so, a single card that loads the fields dynamically works well. If each building has unique information then different cards with permanent data would be a good choice.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Strategy to construct a Stack
All,
Just so I understand the important issues, is it not the fact that multiple users might be trying to access the data at the same time?
Record locking.
The structure of the stack without that issue seems simple; a card for every building, and some gadgetry.
Craig
Just so I understand the important issues, is it not the fact that multiple users might be trying to access the data at the same time?
Record locking.
The structure of the stack without that issue seems simple; a card for every building, and some gadgetry.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Strategy to construct a Stack
You'd only need record locking if users are allowed to edit the data. If so, a lock file on the server is the usual approach.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Strategy to construct a Stack
Jacque.
The OP originally proposed ;
The OP originally proposed ;
CraigThe Database would have to be viewable and editable by up to 10 users.
Re: Strategy to construct a Stack
SQlite is inside livecode, I suggest to use it:tlottrike wrote: ↑Mon Dec 17, 2018 5:34 pmI am trying to plan what strategy I should use to create a sort of Database that keeps records of the buildings we have built. Each building would have basic information like Client, Cost, Number of Storeys etc.
My first thoughts are the user would create a new card based on which building type they are going to record.
The Stack would have a script that would create a new card using a "template script" to make a card that suits each building type.
The Database would have to be viewable and editable by up to 10 users. This last bit I have no idea how Livecode deals with networking different users or even if that is a problem. Hence why I am wondering if this is even the right way to proceed and I should be looking at using some kind of proper database eg SQL ?
Thanks in advance for any advice
Graeme
https://livecode.wikia.com/wiki/SQLite
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w