Re: [exim-dev] Multiline macros or abstract objects?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Michael Haardt
Datum:  
To: exim-dev
Betreff: Re: [exim-dev] Multiline macros or abstract objects?
On Thu, Sep 15, 2005 at 02:02:12PM +0100, Philip Hazel wrote:
> On Thu, 15 Sep 2005, Michael Haardt wrote:
>
> > How about a little object orientation? Specifically, I could imagine
> > abstract routers and transports, and having real routers (transports etc.)
> > extending them.
>
> I suspect this is not even Exim 5 ... but in any case, I'll be retired
> by then.


I am not surprised you say that, but as a matter of fact, the code is
almost there. Right now there are static globals for default routers
and you copy them when creating a new router and use router options to
change the default values.

In OO speak, creating a new router instance inherits all properties from
the abstract super router and lets options override them.

All you can't do right now is comparing router objects and find out
which properties were overriden and which were inherited. I guess you
need an additional pointer for each propoerty that points to the object
that sets it. Right now, unsetting a value results in NULL, but that
may as well have been the inherited default.

The specification may be the hardest point, but the actual code does
not sound too bad. Make "driver = appendfile" the same as "extends
appendfile", and the configuration stays compatible. Still Exim 4. :-)

The advantage would be the same as going from macros to hostlists
between Exim 3 and 4.

Michael