Hey Erik: It's getting late, so I may not be thinking clearly...
On Thu, Jun 06, 2002 at 04:57:42PM -0400, Erik Price wrote: > I have a method in my class that essentially unsets an array element. Uh, I know you're a sharp guy, but I've got to ask anyway. If it's doing such a simple thing, why do you need a method to do it? Why not go ahead and unset the array directly? > Now, originally I was doing all of this method calling from the script > itself. For each variable POSTed by the user, I call the first method. Why not have the function automatically check each variable in POST (you know, do a while loop for each $_POST) rather than have to call the function over and over? That way you can call the thing once and you're done. Plus, you can then either put that second, clean up, step in here or have it a separate function called at the end of this POST check stuff. > But now that I have a second "clean-up" method that needs to be called, > how should I go about it? Should I have one "master" method in the > class that is called from the script, and itself does all the work? > This keeps all of the work in the class, and out of the calling script. > > OR... > > Should I keep the class free of code that only executes according to > POST variables from the user, and keep this kind of thing in the calling > script. That way, the object's class is more flexible, and can be used > in more contexts. I tend to use classes for reusable purposes throughout my projects. So, I wouldn't bog it down with things you're only going to use in one place. Perhaps put this second, clean-up, process in an extension of the primary class? Good night (or good morning by the time y'all read this), --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php