Hi Paolo,

<attempt-to-precise-semantics>
Actually, everything is uniform at this moment. The contract for Component#setEnabled says: * Sets whether this component is enabled. Specific components may decide to
    * implement special behavior that uses this property, like web form
    * components that add a disabled='disabled' attribute when enabled is
* false. If it is not enabled, it will not be allowed to call any listener * method on it (e.g. Link.onClick) and the model object will be protected
    * (for the common use cases, not for programmer's misuse)

Both Link and Button adhere to this contract.
Furthermore Link and Button do not have an extends relation, otherwise the contract could be tightened by one of them.
<attempt-to-precise-semantics>

But I understand your point. Once you expect a component to render differently when it is not enabled, you would like all components to do so.

I know that this is a very little thing, but great stuff are made of little
things also.
I like that statement :)

Regards,
    Erik.


Paolo Di Tommaso schreef:
I disagree about that.

Methods semantics for components should be uniform, this is the most
important rule for API simplicity and coherence.

If Button#setEnabled( false ) is rendering a  button in disabled state, I
will expect that Link#setEnabled( false ) attached to a <input type="button"
/>  tag will do the same.

I know that this is a very little thing, but great stuff are made of little
things also.

Thanks,

- Paolo


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

Reply via email to