It is currently 28 February 2021, 3:29 Advanced search

Global Variables - Design ?

Questions and answers on how to best use Instant Developer

Global Variables - Design ?

Postby john w » 2 February 2021, 16:21

I have an application. In it I import data from csv file and convert that to JSON. The data is not stored it is for an in memory only process.

My app has effectively 15 data points that are used in a number of ways on different apps in the forms. I am wondering if there are issues to loading the JSON data into 15 global variables and then use those in the different application forms as may be appropriate.

I could create and call separate procedures for each form that seem too much. I already have a class created to handle the processing, etc. However, each form is unique enough that each form will require some unique coding in the class. Doable.

It seems to me though I could just run the process once, load the data into global variables and then use them.

Are their problems with doing it global variable I may be missing?

Any thoughts/comments are appreciated.
Regards

John W
User avatar
john w
 
Posts: 629
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Global Variables - Design ?

Postby ljwilson » 2 February 2021, 18:29

Rather than global variables, I would use single row imdb table to store them all.

Other than that should be fine.

...jack
ljwilson
 
Posts: 559
Joined: 26 November 2013, 14:15

Re: Global Variables - Design ?

Postby john w » 2 February 2021, 18:57

Thanks for the response. I think not loading the variables into an IMDB saves me some code. I will try simple global variables first.
Regards

John W
User avatar
john w
 
Posts: 629
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Global Variables - Design ?

Postby ljwilson » 2 February 2021, 21:37

As long as you don't use a global variable as a filter in a master query you should be fine with globals.

...jack
ljwilson
 
Posts: 559
Joined: 26 November 2013, 14:15


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 7 guests

cron