[fpc-devel] Interface delegation fix: backport to FPC 2.4.2 ...?

Michael Van Canneyt michael at freepascal.org
Wed May 19 16:20:35 CEST 2010

On Wed, 19 May 2010, Marco van de Voort wrote:

> In our previous episode, Graeme Geldenhuys said:
>> Marco van de Voort het geskryf:
>>> I'm against. This is a sliding slope. Michael agreeing to this surprises me
>>> a bit.
>> Michael was the one that suggested it to Joost and myself. :) The usage of
>> Observer in base classes might even completely eliminate the need for
>> DB-aware components.
>> system between action and clients to mere 10-15 lines of code. That's a
>> huge reduction compared to the code in VCL or LCL to do similar functionality.
> Note that I was mainly talking about any object types that are designed to
> be Delphi compatible. The extra properties and methods polute the namespace,
> and could get in the way of users own similar systems.
> I don't care about such schemes being used in code that is not Delphi compat
> (fpgui, fpweb etc). I wouldn't like it for the database components or LCL
> components though.

The problem is that this pretty much rules out the use of the observer
pattern, because you need to subclass every existing class that you want
to work with, which is exactly the problem that we're trying to solve in 
the first place. To be effective, it needs to be in the base classes.

I have an implementation in place, which doesn't affect too much the
existing classes: it adds 1 public property and one private method; 
There is no impact on code efficiency.

I am all for systems to reduce namespace pollution and minimalizing impact
for the users, but maintaining the status quo forever is also not an option.


More information about the fpc-devel mailing list