473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

classMember within classFunction theory question

ed
Question about the following example code:
*
var something = {
*
*********** classMemberObjRef : null,
*
*********** randomOperation : function() {
*
*********************** var localObjRef = something.classMemberObjRef;
*
*********************** ...
******** ***}
*** ****
*** **** secondOperation : function() {
*** **** **** ****
*** **** **** **** var localObjRef = something.classMemberObjRef;
*
*** **** **** **** ...***
*** **** }
}
*
*
I've seen this a few times, and am not sure what the need is to create
localObjRef for each function.* Is this a simply a best practice, or is
there something else to it? Is there some sort of scoping issue that
will prevent direct access to something.classMemeberObjRef?* Will it
vary per-function?* Just looking for some info I can't find in my books....

Jun 19 '07 #1
1 1088
ed
Sorry, I don't know what I was thinking... classMemberObjRef, pretend
it is set to something OTHER than null!

On 2007-06-18 22:32:03 -0400, ed <us**@superhoost.comsaid:
Question about the following example code:
*
var something = {
*
*********** classMemberObjRef : null,
*
*********** randomOperation : function() {
*
*********************** var localObjRef = something.classMemberObjRef;
*
*********************** ...
******** ***}
*** ****
*** **** secondOperation : function() {
*** **** **** ****
*** **** **** **** var localObjRef = something.classMemberObjRef;
*
*** **** **** **** ...***
*** **** }
}
*
*
I've seen this a few times, and am not sure what the need is to create
localObjRef for each function.* Is this a simply a best practice, or is
there something else to it? Is there some sort of scoping issue that
will prevent direct access to something.classMemeberObjRef?* Will it
vary per-function?* Just looking for some info I can't find in my books....

Jun 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Xah Lee | last post by:
Dear functional programing comrades, Among the community of automatons of the IT industry, there is a popular quote about "theory vs practice" that goes something along the lines of "in theory...
12
by: M Wells | last post by:
Hi All, I have a table that holds pregenerated member IDs. This table is used to assign an available member id to web site visitors who choose to register with the site So, conceptually the...
6
by: ccdrbrg | last post by:
What is the best way to protect stdin within a library? I am writing a terminal based program that provides plugin capability using the dlopen() API. Sequencing program commands (typed) and...
6
by: Carlos | last post by:
Hi all, I am trying to access a public field of another form class within the same namespace. The field is public, what is the best way to access it from a different class? I defined as private...
8
by: Amelyan | last post by:
I need some help to confirm my theory! I think I discovered something new for myself about behavior System.Web.UI.Page. THEORY: Every time I change control on my WebForm1 page that results in...
26
by: johkar | last post by:
I need to cancel the link and execute a function onclick of all the links within the span tag which has a class of "container" assigned. There will be only one span tag with this class applied. ...
4
by: Clarence | last post by:
I'm having problems creating classes because of "can't create a consistent mro" problems. I noticed, in a test program, that if the base class list that I pass to type.__new__ is sorted (using...
2
by: Aaron Scott | last post by:
Is it possible to change the content of a function after the function has been created? For instance, say I make a class: class MyClass: def ClassFunction(self): return 1 And I create an...
25
by: Thomas R. Hummel | last post by:
I'm going to try to describe this situation as best as I can, but if anything is unclear please let me know. Some of this database was already in place before I arrived on the scene, and I don't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.