In a set method for address (for example), that doesn't actually update the
database does it? It simply changes the value stored in the session var or
something?

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Steve Brownlee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 17, 2006 11:16 AM
To: CF-Talk
Subject: RE: OOD/Design Patterns and ColdFusion.


1. Validation
2. Encapsulation
3. It just makes so much darned sense, don't it?

For many web app developers, classes (or beans in this discussion) are
code representations of database objects and so must perform the
function of getting data from, or putting data into, those database
fields.  Keep in mind one of the basic tenets of OOP: encapsulation.
Encapsulation is done in the hopes of preventing us silly, little humans
from messing up our data by adding more rules and processing than is
necessary.

If you have one get/set for each attribute, then the code for those
methods are ridiculously straightforward and very hard to mess us.  If
you, however, have one method to accept all attributes in some sort of
delimited format, then the rules becoming much more complex and the
chance for bugs and bad data increase exponentionally (just a figure of
speech, I have no proof that it is exponential).


Steve "The Boss" Brownlee
http://www.orbwave.com/cfjboss


-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 17, 2006 10:09 AM
To: CF-Talk
Subject: RE: OOD/Design Patterns and ColdFusion.

Steve...

I do have one comment/question about your example. It seems to be a
little excessive to have a get and set method for each individual column
in a database. Can you explain the reasoning behind this?

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240776
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to