The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 02:18:25 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: @perks  (Read 1558 times)
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« on: September 23, 2009, 04:37:32 AM »

Too lazy to look up the post.
But where u wanted to set/get the property of ur widget.
And see if it changed.
I suggested a getter/setter
but maybe u could use a "watch" which is like a perl tie.

https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/watch
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: September 23, 2009, 10:46:15 AM »

Thanks Nop ... actually I don't need to get/set, I thought that was someone else...

the PHP get/set is rather crappy in that ALL properties are set through a single magic method... and if you define the method, then all getting or setting goes through it. It's a PIA and doesn't "feel" right. It can be used (I've used it thus) to limit access or even ensure that you're doing things correctly: you can spontaneously "set" an object property that doesn't even exist, so the ability for you to create code where you think something's happening but it really isn't is high - so the ability to lock down / add code to the getting/setting of properties is good, but it's not entirely well thought out IMO. Using it you could also do type enforcement. I just don't care for it very much.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!