PHP Classes

Consistency and style

Recommend this page to a friend!

      Easy Mail  >  All threads  >  Consistency and style  >  (Un) Subscribe thread alerts  
Subject:Consistency and style
Summary:A couple of suggestions...
Messages:2
Author:Richard Munroe
Date:2006-04-07 09:40:09
Update:2006-04-08 03:02:05
 

  1. Consistency and style   Reply   Report abuse  
Picture of Richard Munroe Richard Munroe - 2006-04-07 09:40:09
Dolly,

This is a great package, just enough mechanism, not too much (like most of the other email classes). This class would be helped a lot if the file name of the class and the name of the class you have to use for the new operator would be the same. I keep assuming that the class and the file name are the same and finding out at run time that they aren't.

I would change the constructor to have [optional] arguments that I could use to set the message header data, e.g.:

new Easy_Email($to, $from, $subject, $return)

or something like that.

Personally I don't like accessing data members directly so this would clean up a lot code for me since I could initialize everything in the constructor.

You might also consider adding accessor functions to set the member data as well to improve encapsulation.

Keep up the good work.

Dick Munroe

  2. Re: Consistency and style   Reply   Report abuse  
Picture of Dolly Aswin Harahap Dolly Aswin Harahap - 2006-04-08 03:02:05 - In reply to message 1 from Richard Munroe
Thanks for your response. I will implement it in my class