Greger,

Greger wrote:

Is there anything in particular that one should take into account regarding
modperl and design patterns vs trad CGI-scripting?

As for now, I return XML from the package methods, and use XSLT for the
transformation to XHTML. This works very well, seems flexible, but are there
better ways?

The only thing I'd say there is that while it's flexible, you're doing a lot of processing that you might not need to - why not get the package methods to return a Perl structure (eg. a ref to a hash of hashes/lists etc), and if you want to XML-ify it, make a wrapper class that extends your base class by converting the return values into XML.

That way you can re-use the original package in code without unnecessary XML encoding/decoding.

Also check out the wiki http://www.perldesignpatterns.com/ - I wish I'd known about design patterns sooner, I'm trying to tidy up a god object now :(

cheers
John

Reply via email to