[Flashcoders] Implicit Setters: Is validation considered a good or bad OOP practice ?

2006-09-25 Thread David Bellerive
I've been reading and learning about OO design analysis for the past few months and I've just recently started applying what I've learned in my Flash projects ? Learning a new language (like AS3) is no biggie but learning how to code differently (from procedural to OOP) is the real challenge for

Re: [Flashcoders] Implicit Setters: Is validation considered a good or bad OOP practice ?

2006-09-25 Thread Nicolas Cannasse
3) Validate the value and it it's an undesired value, throw an error ? Here, the component prevents the user from assigning and undesired value like NaN or undefined and the user is alerted of the failure at runtime provided that he used a try catch statement. What do you guys think ? (3)

Re: [Flashcoders] Implicit Setters: Is validation considered a good or bad OOP practice ?

2006-09-25 Thread slangeberg
so if it's a bad input, it cannot tell the object that is modifying the setter property that something went wrong. Not sure if it's the best practice, but if someone passes in a bad input to your setter, in AS3 you can throw errors, such as: public function set volume( val:Number ) { if (

Re: [Flashcoders] Implicit Setters: Is validation considered a good or bad OOP practice ?

2006-09-25 Thread Jim Kremens
Not sure if it's the best practice, but if someone passes in a bad input to your setter, in AS3 you can throw errors, such as: You can do the same thing in AS2, of course... Jim Kremens On 9/25/06, slangeberg [EMAIL PROTECTED] wrote: so if it's a bad input, it cannot tell the object that is