Re: DB_DataObject: what am I missing?
| From: | Larry Garfield | Date: | Sun, 23 Jan 2005 21:35:34 +0000 |
| Subject: | Re: DB_DataObject: what am I missing? | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17116@lists.php.net to get a copy of this message | ||
Torsten Roehr wrote:
Excuse me a momentary expletive. w00t! :-) Sounds like the best of both worlds. Fortunately I've not done so much yet that I couldn't convert it back to using methods given 10 minutes or so. Do you know when the next "official" release of DBDO is that will include that feature? (I'm always wary of CVS nightlies.)The current bug aside, why are people so against overloading? Without the accessor/modifier methods, you have to access the data directly, which breaks encapsulation. (Yes, I happen to like OO concepts. <g>) You could just write them yourself (as you would have to in Java or many other languages), but then you're losing half of the point of using DBDO in the first place.Hi Larry, my patch that adds automatic generation of getters and setters to the DB_DataObject class generator has been added to CVS two days ago. So you don't have to "write them yourself" anymore ;)
Using overload for accessors may be decent but setters should be customized to include proper input validation.I certainly can't disagree there. (One of the reasons I prefer methods over direct access.) -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson