lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Wellnhofer <>
Subject Re: [lucy-dev] Promoting new analysis components
Date Fri, 10 Feb 2012 20:35:21 GMT
On 10/02/2012 19:41, Marvin Humphrey wrote:
> As an academic exercise, though, I'd like to explore how Dump/Load might still
> work under subclassing.


> Therefore, we need to override Load() in the subclassed CaseFolder.  We can't
> invoke the super Load() method, but that's OK -- we can go through
> CaseFolder_init() to flesh out the object:
>      CaseFolder*
>      CaseFolder_load(CaseFolder *self, Obj *dump) {
>          UNUSED_VAR(dump);
>          return CaseFolder_init(self);
>      }

 From an academic point of view, this is ugly because it would break if 
someone implements another set of Dump/Load methods in a parent class of 
Normalizer (for example Analyzer) and expects them to be called from all 

On the plus side, it would allow us to completely remove the Transform 
methods of CaseFolder. But the methods are already there and we only 
have to convert them to wrappers around Normalizer.

IMO composition is the most maintable approach, because it doesn't 
require deeper knowledge of the Dump mechanism.


View raw message