> But I was lookin at Joe's legacy samples ...
I wouldn't read too much into samples. I haven't looked at the sample in
question, but it may not be a complete application.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
>Well, the example I created was pulled right out of my ... imagination. But
>if you create different object instances for each user, and store those in
>each user's session, the fact that you have the same structure for each of
>those instances doesn't matter at all.
>
But I was lookin at Joe's le
> One thing that's messin' up my head is, these cfc's are
> usually stored in application scope. This information looks
> more like personalized info, which is usually stored in
> session scope.
>
> I'm not understanding how info doesn't get crossed up between
> users. lol!
Well, the example
>
>
>
>
>
>
>
>
>
>
Thanks dave! Oops Dave (ahemm)
One thing that's messin' up my head is, these cfc's are usually stored in
application scope. This information looks more like personalized info, which is
usually stored in session scope.
I'm not understa
> I'm just not understanding why I'd need a getter and a setter
> in my cfc.
>
> ...
>
> What is the value of keeping each value in its own variables
> scoped variable? Where does it come in handy? Where are you
> supposed to use it?
As many people have mentioned, you don't need getters and s
> Just to be difficult,
You mean like this:
--
s. isaac dealey ^ new epoch
isn't it time for a change?
ph: 617.365.5732
http://onTap.riaforge.org/blog
~|
Adob
Thank you all for the info. It's most helpful!
Will
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://
As others have pointed out, getters and setters are there for encapsulation.
For example, if you have a getPrice() method on a Product, right now it
might return just a price instance variable. But later you may need to add
in much more complex logic such as tiered pricing for certain customers,
sa
Will,
Many of the ideas within OO are to promote encapsulation, easy reuse, and
increased maintainabilty. In your example, it may be much easier to submit
a form to a page that takes those values and adds them to the database. But
for example lets say you are storing a "customer", and that you mu
Just to be difficult,
>>>
You cannot set or get the variables scope directly, so you need the getter
and setter to do this.
>>>
Actually, in Coldfusion you can. Of course, you have to reference them
somewhere else in you CFC if you want to access them from outside your CFC,
but it doesnt HAVE to
nal Message -
From: "Will Tomlinson" <[EMAIL PROTECTED]>
To: "CF-Talk"
Sent: Monday, June 23, 2008 9:46 AM
Subject: Why do I need getters/setters?
> I'm just not understanding why I'd need a getter and a setter in my cfc.
>
> My app works just fine
will not work otherwise. They exist to accommodate
and encourage good coding practices. YMMV.
~Brad
-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2008 11:46 AM
To: CF-Talk
Subject: Why do I need getters/setters?
I'm just not understanding
as I don't see much value in it, but then I'm
self taught and OO isn't really a big concern for me ATM. I can easily see
this changing over time though.
-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2008 11:46 AM
To: CF-Talk
Subje
Short answer... You don't
You CAN build CFCs pretty much anyway you want to. Frankly, in CF if it
works, and you like how it works, then it's perfect.
Using getters and setters is really more of an OO habit than anything else
in CF.
--
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Devel
I'm just not understanding why I'd need a getter and a setter in my cfc.
My app works just fine without setting anything in the variables scope of my
cfcs. You submit a form, it adds the values to my db. You run a query and get
all the values back out.
What is the value of keeping each value
15 matches
Mail list logo