Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [handly-dev] Proposed API change: IModule


On Mon, Mar 2, 2015 at 12:04 PM, Vladimir Piskarev <pisv@xxxxx> wrote:
 > Is ISourceConstruct.getSourceFile really necessary anymore?

Good question!

I decided to keep it mainly for binary compatibility (though the contract compatibility is apparently broken, existing model implementations will not be affected by it).

Also, this method can conveniently save a downcast, especially for models that have only "source" modules, for which the check for the null return value is not necessary. (And that's the only models Handly supported thus far).

However, I agree that leaving this method in place may muddle the waters a bit.

I think we can deprecate and remove it eventually if the need arises. Do you feel that removing it now would result in a much cleaner solution?

Well, does a SourceConstruct ever care that the Module it's located in is a source file or something else? From what I can see, it doesn't and I think it shouldn't. 

I know that sometimes it's nice to have shortcut methods that assume things (I do that too, often), but what is ok in an application might be less so in a framework. I like your decision to keep Handly simple and not make assumptions - I think this is a case where you should stay true to that even if it breaks compatibility. After all, one of the main purposes of 0.x versions is to reveal the API: if one gets locked already at v0.2, then it could just as well be named 1.0. :-)

regards,
Vlad


Back to the top