• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Domination

Page history last edited by John Sindelar 14 years, 4 months ago

Simply taking a walk through one of my most recent solutions (happens to be Theme Library 4 - no pitch here) and showcase the various ways I use Global variables to make a really trim solution with a lot of advantages.

 

Host: Matt Petrowsky 

Comments (7)

Bruce Robertson said

at 12:51 am on Apr 1, 2010

FWIW FileMaker container fields have been able to store native FileMaker layout objects since FM7. Be in layout mode in one window, drag to browse mode container field in another window; all attributes preserved. Also, Mac folders can do the same thing. Drag layout objects to folder, drag back into same/different layout, all attributes preserved.

Don Levan said

at 10:42 am on Nov 30, 2009

"this is where we talk about tight namespacing" - Looking forward to it.

Matt Petrowsky said

at 10:28 pm on Nov 29, 2009

Ahhhh, this is where we talk about tight namespacing... should be good stuff to talk about.

Don Levan said

at 2:14 pm on Nov 24, 2009

Just to clarify here, I am not advocating not using global variables. Nor am I really concerned about the security implications. Rather, I am trying to raise awareness that using global variables increases coupling and that can make a system harder to debug and extend. The only inherent problem with letting them hang out there is there is no guarantee about what will step on, change, or destroy them.

John Sindelar said

at 1:19 pm on Nov 24, 2009

We're on the same page. And that security thing seems pretty loose to me: if there is something someone shouldn't see in a $$var, then your environment let runtime access that object at some point when it shouldn't have and you simply need to tighten your access privs.

Matt Petrowsky said

at 1:05 pm on Nov 24, 2009

Well, I would suggest anyone with that sentiment not listen to what I have to say. ;) Sounds counter intuitive to me. Sort of like "Hey, here's a bucket you can fill with water - but don't do that, it's bad practice." Memory is pretty inexpensive these days and most computers will have plenty.

Anything you are going to store will have a certain "weight" in bytes. All you need to do is be aware of what you are storing. If it's a 4 GB image (or chunk of text - unlikely) then you'll certainly want to destroy your global variable - or never use it in that case. If it's a few k, then I'd rather store it in resident memory than keep writing it to disk or, for that slower FileMaker solution, over the network.

Security can be a concern when storing sensitive info within global vars - but this can be addressed.

"Good practice", as far as I'm concerned, can be translated into "In my opinion" which results in "We'll have to agree to disagree" :) But then some people call me a 'rebel' [wink]

Looking forward to having the discussion!

John Sindelar said

at 12:15 pm on Nov 24, 2009

Excellent! Just has a long discussion at FMPug here with Don Levan and Stephen Gallagher about "leaving global $$vars hanging out there" and whether that is "good practice". Interesting, but I'm not sure the warnings against this from other dev environments translate to FMP.

You don't have permission to comment on this page.