Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why a factory?

Status
Not open for further replies.

ericbrunson

Technical User
Joined
Jan 9, 2004
Messages
2,092
Location
US

I'm using PEAR MAIL to do some mailing, but I would like to subclass the mailer object to better abstract the interface for my own purposes.

But, it seems I can't because mailer objects are created using the MAIL::factory() method and there are only 3 kinds of mailers it knows how to instantiate. I could subclass the mail object and override the factory method, but why?

It's like someone read the chapter on Factories in Programming Patterns, but didn't really understand what they were for? All I see it doing is overly complicating the issue.

Anyone want to explain this or flame me on the issue?

 
I'm not sure I understand your question.

It seems to me that the use of a factory method would allow for easier extensibility.

But then, if you're talking about the PEAR Mail class maintained by Chuck Hagenbuch, Richard Heyes, and Jon Parise, why don't you email them and ask them? On the PEAR page for the class, it is possible to access the email addresses of Misters Hagenbuch and Parise and there is a webform to email Mr. Heyes.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top