|
Posted by Osewoudt on 03/29/07 10:26
> It appears that the class would only ever be a single instance.
> If so you should be setting the values within the constructor.
> ie;
> $test = new WachtwoordGenerator(8, 3, 2, 4);
that is the way i did it in an earlier version, but then i read about __set
and __get so i wanted to use that.
> Although this appears to be a test and learning project it's a good time
> to
> create some good habits.
> The class should encapsulate more functionality than this one does.
> The numbers "8, 3, 2, 4" have to come from somewhere. Why not generate
> them
> within the class itself with rand numbers.
> Then you could do the following;
> $test= new WachtwoordGenerator();
> $password = $test->pword();
now you can control yourself how many elements there are in the password and
from which set of caracters they come.
No, I'm not calling you a "dipstick" :)
then you are the first who doesn't
> No crticism inteded here, just a nudge toward a better understanding of
> the
> use, and usefullness, of classes.
yes, that is the way i understand it and i am glad you took the time to give
some advice.
thanks,
henri osewoudt
Navigation:
[Reply to this message]
|