I should have said "aren't always constants".

/charlie

-----Original Message-----
From: charlie arehart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 3:39 PM
To: SQL
Subject: RE: Database configuration ?


Right. Class vars aren't constant--they're just one per class, rather than
one per object.

So I was suggesting that this is like in a table where we may keep some data
in one record, like the current balance for an account in an accounts table,
rather than storing it redundantly in each "transaction" record in an
associated transaction table.

The analogy may not make sense to all. My point was just that sometimes it
may be easier to appreciate how object design works from finding corollaries
in database design. Like Max clarified in his last note, this is not really
the same as discussing object databases or object-relational mapping. I
really wasn't meaning to go down that path. :-)

/charlie

-----Original Message-----
From: Dean H. Saxe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 10:48 AM
To: SQL
Subject: Re: Database configuration ?


At 09:36 AM 1/16/02 -0600, you wrote:
>regarding the sentence in your post about moving data from instance
>variables to class variables to avoid redundancy, i'm not sure what you
>mean. i did take 'java' but haven't used it much. doesn't an instance
>variable store a unique value of an object of a class while a class
>variable refers to a static value (constant) that is shared by all
>objects?

Instance variables are always associated with an instance of a class (an
object).  Class variables are shared across all instances of a single class
(indicated by the static keyword in the variable declaration), modify its
value in instance A and instances B-Z also reflect the change.

For instance:

public class TestClass
{

private String instanceVariable = "A variable which is unique between
instances of this class";

private static String classVariable = "A variable shared between all
instances of this class.";


public TestClass()
{
         // constructor
}

}

-dhs


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to