Joe, 

I mostly agree with your opinion. But remember that a method in an
object that has output doesn't have to print the output - it can return
it instead and the calling function can then either display the output
or do something else with it. And if it makes sense to have a method
return HTML, another developer can override that method so that it
returns XML. Or yet another method could take the HTML output of the
first one and convert it to PDF. 

The question, I think, is about figuring out the most effective place to
do what solves the problems. I'm afraid that saying "You should never
ever ever write an OOP method that has HTML in it's output" is so rigid
that it might make the development process more difficult and complex
than it needs to be.

Michael

On Thu, 2003-05-29 at 11:28, Joe Stump wrote:
> Sure ...
> 
> I'm of the belief that OOP (in PHP anyways) has great use for core
> libraries. Core libraries, by their nature, generally don't output HTML.
> It's a core libraries job to separate logic and presentation. How portable
> is your library that outputs HTML for a guy who wants PDF/WAP/XML output?
> 
> For instance, I have a product class that does various things to format
> product *data* prior to my procedural scripts putting it into my Smarty
> templates. If that product class outputted the data in HTML it would be
> useless to me for WAP users or a script that generated PDF versions of our
> online catalog.
> 
> --Joe
> 

> 
> -----Original Message-----
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 29, 2003 8:21 AM
> To: 'Joe Stump'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: PHP OOP x Procedural Performance
> 
> 
> > One thing I'd like to abundantly point out is that NOT
> > EVERYTHING BELONGS IN
> > OOP! For instance, if you're building classes that output
> > HTML - you've
> > skipped a few chapters in your OOP design books.
> 
> Joe,
> 
> I am curious about this opinion, could you elaborate a bit, please? I am not
> an OOP programmer, and I'm just interested in your thoughts on this, if you
> have time.
> 
> Kirk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to