Another Log implementation

Daniel Gibson metalcaedes at gmail.com
Sun May 29 16:32:44 PDT 2011


Am 30.05.2011 00:55, schrieb Vincent:
> On Sun, 29 May 2011 22:05:23 +0200, David Nadlinger <see at klickverbot.at>
> wrote:
> 
>> Uh, IMAP has nothing to do with sending mail
> 
> For bores: Just an example that 'mail' doesn't mean 'SMTP'. Naming
> functions based on low level details leads to unavoidable refactoring.

In the contrary: Assuming that an alternative to SMTP will emerge, you
can't assume that anyone supports it (just like not every server that
supports pop3 also supports IMAP).
So if it's just "EmailLogEngine" or whatever and it's using SMTP,
changing it to use the SMTP-alternative will break the logger for
everyone whose mail-server only supports SMTP.
So calling it SMTPServer is smarter - if you ever want to use something
else for mail-based logging just implemente a FooBarLogEngine and change
the parts of your code (probably it's just one part, anyway) to use the
FooBarLogEngine instead of the SMTPLogEngine.

Cheers,
- Daniel


More information about the Digitalmars-d mailing list