setProp and Lock messages

Richard Gaskin ambassador at fourthworld.com
Sun Dec 4 12:45:50 EST 2011


Todd Geist wrote:

...
> But I like all of these more than the alternative of using accessors on
> library stacks with name spaced accessors
>
>    db_Contacts_getVersion
>
>    // or
>
>    db_getVersion("Contacts")
>
>
> Although this is a lot less typing, I just don't care for it. Maybe I am
> stupid...

My apologies: I didn't mean to imply that using getProp/setProp was in 
any way "stupid".  On the contrary, for some problems they provide an 
unbeatable solution.

Those familiar with Cocoa's CoreData are no doubt impressed with the 
power of name-value-pair (NVP) programming, some of which can be 
simulated in LC with getProp/setProp.  Nothing wrong with that at all.

That's one of the great things about LC:  there are many ways to solve 
problems, supporting a wide range of coding styles.

If you like NVP use it.  The main point of my post was just the caveat 
about how lockMessages can affect NVP-based systems.  If your systems 
can account for that there's certainly no harm in using getProp/setProp.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the Use-livecode mailing list