[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [handly-dev] On the way to non-breaking evolution
|
Hi Vlad,
Thank you very much for taking a look, and the prompt feedback!
These are all very valid concerns, but I hope that they have been addressed, although it might not be obvious in the diffs.
* "The properties that are meant to be used as API should be documented" - Absolutely! It becomes even more important to thoroughly document APIs in this more loosely-coupled, context-based design. I tried to document all of the API elements, including the properties. In particular, CREATE_BUFFER is documented in both ISourceFileImpl#hBuffer and Elements#getBuffer besides the JavaDoc for the property itself.
* " An alternative could be to define sets of properties that belong together as enums" - Please see org.eclipse.handly.util.ToStringOptions in the master branch :-)
* "What about properties' names - is it ok if they aren't unique?" - Please see the JavaDoc for IContext (in the master branch). It specifies that "Context implementations may use an identity-based lookup, name-based lookup, or anything in-between. For portability, keys should be unique instances with unique names." So yes, property names should be unique in a context if portability between different context implementations is to be ensured. Currently, we provide context implementations with identity-based lookup (Context, Contexts) and "name+type" property lookup (GuiceContext, not used currently).
Again, thanks for the constructive feedback! I really appreciate it. Please let me know if you see any other issues.
Best regards,
Vladimir
Hi!
Looks nice, but there is one thing that I think is missing (or I missed it in the diffs): the properties that are meant to be used as API should be documented. For example, SourceFile#hBuffer's docs should mention that CREATE_BUFFER is a relevant property for it.
Also, I am not sure if using the same mechanism for utilities is working well. For example, hToString(Context) -- the properties for this utility are probably going to be unique to it, and my feeling is that a ToStringConfiguration class would be easier to understand. If these values need to be used in the context of a Context (!), then the whole class can be stored in a property instead of each individual value. It's possibly a matter of taste. An alternative could be to define sets of properties that belong together as enums.
What about properties' names - is it ok if they aren't unique? As it is now, one can inadvertently create a property with the same name as another, but with different semantics. I can't check the implementation right now, so I'm doing the lazy thing here :-)
best regards,
Vlad