[dev] Naming scheme for Imp MIME viewers

Michael M Slusarz slusarz at horde.org
Tue Aug 10 06:58:10 UTC 2010


Quoting Gunnar Wrobel <p at rdus.de>:

> Hi!
>
> When looking at IMP_Horde_Mime_Viewer_Html in  
> imp/lib/Mime/Viewer/Itip.php (horde git repo) I was wondering why it  
> was named that way. My expectation was that the class name is  
> IMP_Mime_Viewer_Html. The latter would seem to make autoloading  
> easier but I assume there is a good reason why the class name starts  
> with "IMP_Horde_...". Maybe somebody can enlighten me.

It was historical.  Back in the day, MIME Viewers were one of the  
first set of drivers that could live in an application but extends a  
Horde/Framework library.  It was easiest to simply tack the  
application name on front of the "expected" classname (i.e. the name  
the driver would have if it lived in Horde).  Since we didn't need to  
worry about autoloading, it did not really make any difference, as  
long as the naming scheme was consistent.

But all of this will be moot soon (hopefully in a day or two) - I have  
been working over the last week to make all Horde Mime Viewer code  
injectable.  A necessary step in doing this was making the application  
Mime Viewer drivers autoloadable, so the class naming system is  
consistent with the rest of the classes/libraries.

So once I commit this code, this whole discussion becomes moot.

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list