Mega Search
23.2 Million


Sign Up

Make a donation  
Extending class without inheritance  
News Group: embarcadero.public.delphi.oodesign

Advantage or limitations of class helpers vs. the Decorator pattern

Or any other suggestions ?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 21-Jan-2015, at 2:38 PM EST
From: Gilbert Padilla
 
Re: Extending class without inheritance  
News Group: embarcadero.public.delphi.oodesign
> {quote:title=Gilbert Padilla wrote:}{quote}
> Advantage or limitations of class helpers vs. the Decorator pattern
> 
> Or any other suggestions ?


Interfaces and aggregation. 

An interface is a contract (describes what an object does), not how it's implemented. For example, an "iLogfile" interface could be a file, a stringlist or a serial comms class and all would be perfectly interchangeable though none of them share a common base class. They need not even derive from tInterfacedObject (one can add the nuts and bolts such as _addref manually).

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Jan-2015, at 12:54 AM EST
From: Arthur Hoornweg