You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Emond Papegaaij <em...@topicus.nl> on 2017/04/03 07:20:33 UTC

[VOTE] Proposal to remove IDetachable from IModel hierarchy

TL;DR Vote at the bottom

On zondag 2 april 2017 00:25:12 CEST Pedro Santos wrote:
> > The major concern I have with this change is that it does not improve
> > anything. This change has impact on both the calling and implementing
> > side of detach. Neither side becomes easier.
> 
> It does improve the IModel interface hierarchy by removing an unnecessary
> superinterface, and by fixing the code semantic by removing an empty method
> that wasn't default, but was written as one.

I do not agree here, as I see detach as an integral part of the IModel lifecycle. But I don't 
think we are going to agree on that.

> > The caller (i.e. component) still always has to call detach on all models
> > (now guared by an instanceof), because it can never be sure that the
> > actual implementation will or will not be detachable.
> 
> No, the caller needs to call detach if the model is detachable only.
> 
> > For example, if the type is MyCustomModel (which does not implement
> > IDetachable), a subclass of this type might implement IDetachable. Also,
> > the implementation of MyCustomModel might change in the future.
> 
> You are clearly generalizing a very specific use case, you can't say "still
> always has to call detach". In this specific use case, where you have a
> polymorphic type, yes you do have to check if the instance is detachable.
> This occurs in Wicket's core because it's the place where generic model
> wrappers abstractions are defined and provided for the final user. If
> Wicket's core abstractions do their job right, this complexity should be
> taken away from the final user.

Types in Java can always be polymorphic (except when they are final). A well written 
component does not depend on the specifics of its models. Therefore a component should 
be built on IModels *and* detach these model. That's the only way it will work for all types 
of models.

> What do those models have in common? They are all wrappers to other models.
> If we pass through this proposal, we will be able to go ahead and propose
> to remove their IDetachable interface; that was wrongfully ( and
> unthoughtful because it was forced via IModel ) add as their superinterface.
>
> > On the side of the implementation for new models not much changes. You
> > don't need to implement detach() when you don't need it.
> 
> No, you *do need*, and you *already implemented* it by choosing to
> implement IModel. You clearly mean here that you successfully hide from
> the user an empty method, written with a semantically wrong word, enforced
> by a contract that shouldn't be there in the first place. It's just
> trickery, not a good interface not enforcing an unneeded method.

What I mean here is that you do not have to write any code.

> > If you do need it, you now
> > need 2 changes: implement IDetachable *and* implement detach().
> 
> No, a detachable model *always needed* to implement IDetacheble interface,
> no changes here.

What I mean here is that the author of a model that requires detach() now also has to add 
'implements IDetachable'. This was not needed before, because it was inherited from 
IModel.

I think we are not going to agree on this proposal. I think it is not an improvement and I do 
not agree with you that IModel should not be detachable by default. So lets vote on this.

[ ] Yes, remove IDetachable from IModel

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Emond Papegaaij <em...@topicus.nl>.
The vote is closed with:
1x Yes, remove IDetachable from IModel
7x No, keep IModel detachable

So we can conclude that IModel will remain detachable.

Best regards,
Emond

On maandag 3 april 2017 09:38:03 CEST Emond Papegaaij wrote:
> Something went wrong sending this mail. I did write some more, but somehow
> my mail client lost it. So here's the vote again:
> 
> I think we are not going to agree on this proposal. I think it is not an
> improvement and I do not agree with you that IModel should not be
> detachable by default. So lets vote on this.
> 
> [ ] Yes, remove IDetachable from IModel
> [ ] No, keep IModel detachable
> 
> My vote:
> -1 keep IModel detachable
> 
> Best regards,
> Emond



Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Emond Papegaaij <em...@topicus.nl>.
On dinsdag 4 april 2017 00:24:56 CEST Pedro Santos wrote:
> > TL;DR Vote at the bottom
> 
> What does it mean? That your email can be skipped to the voting part or
> that I was prolix in my last email?

I suspected the discussing was becoming is a bit lengthy for everyone to 
follow. So to make sure everyone read the most important part of the mail, I 
put that at the top. Unfortunately, my mail client decided to chop off that 
part :)

> > I think we are not going to agree on this proposal.
> 
> No problem. Having different opinions being discussed is just a sign of a
> healthy project.

Indeed it is, and it was a good discussion. But as with all discussions, it 
must come to an end at some time :)

Emond

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Michael Mosmann <mi...@mosmann.de>.
[X] No, keep IModel detachable.

.. i did once a refactoring to build an IReadonlyModel,and failed. I failed 
because of the limited feature set of the java language. So you will end up 
with some kind of compromise,which is not near a perfect solution.

Maybe there is a much better way to handle this leaky request/response 
abstraction... But IMHO removing IDetachable will not be a step in this 
direction.

Michael:)

Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 4. April 2017 5:25:05 vorm. schrieb Pedro Santos <pe...@gmail.com>:

> Hi
>
> Emond,
>
>> TL;DR Vote at the bottom
>
> What does it mean? That your email can be skipped to the voting part or
> that I was prolix in my last email?
>
>> I think we are not going to agree on this proposal.
>
> No problem. Having different opinions being discussed is just a sign of a
> healthy project.
>
> Carl,
>
> Indeed, and it's really nice to get you option on this. I also see this as
> a tradeoff situation.
>
> Martijn,
>
>> models only live during
>> actual request processing
>
> They live longer. They even implement IClusterable (IDetachable's
> superinterface) to do so. IClusterable being IDetachable's superinterface
> is a living paradox for me.
>
> [x] Yes, remove IDetachable from IModel
>
>
> Pedro Santos
>
> On Mon, Apr 3, 2017 at 10:49 AM, Martijn Dashorst <
> martijn.dashorst@gmail.com> wrote:
>
>> While I appreciate the effort in questioning our fundamentals and
>> trying to improve even the oldest parts of our API, I don't think that
>> the detach method is semantically wrong for models. Semantics are
>> defined by what we say the semantics are. In a request/response
>> oriented environment a detach is an essential part of the lifecycle of
>> a request in general, and for models in particular.
>>
>> Were Wicket a Swing framework, I would consider modifying the API, but
>> as Wicket lives in an environment where the models only live during
>> actual request processing, and are literally detached otherwise,
>> IModel implementations should have detach behavior, and therefore the
>> framework must guarantee that it can call the detach logic at
>> appropriate times. Therefore IModels *are* IDetachable.
>>
>> So I don't think we should remove IDetachable from IModel as it is an
>> essential, integral and semantically correct part of models.
>>
>> [X] No, keep IModel detachable.
>>
>> Martijn
>>
>>
>> On Mon, Apr 3, 2017 at 9:38 AM, Emond Papegaaij
>> <em...@topicus.nl> wrote:
>> > Something went wrong sending this mail. I did write some more, but
>> somehow my
>> > mail client lost it. So here's the vote again:
>> >
>> > I think we are not going to agree on this proposal. I think it is not an
>> > improvement and I do not agree with you that IModel should not be
>> > detachable by default. So lets vote on this.
>> >
>> > [ ] Yes, remove IDetachable from IModel
>> > [ ] No, keep IModel detachable
>> >
>> > My vote:
>> > -1 keep IModel detachable
>> >
>> > Best regards,
>> > Emond
>> >
>> >
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>



Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Pedro Santos <pe...@gmail.com>.
Hi

Emond,

> TL;DR Vote at the bottom

What does it mean? That your email can be skipped to the voting part or
that I was prolix in my last email?

> I think we are not going to agree on this proposal.

No problem. Having different opinions being discussed is just a sign of a
healthy project.

Carl,

Indeed, and it's really nice to get you option on this. I also see this as
a tradeoff situation.

Martijn,

> models only live during
> actual request processing

They live longer. They even implement IClusterable (IDetachable's
superinterface) to do so. IClusterable being IDetachable's superinterface
is a living paradox for me.

[x] Yes, remove IDetachable from IModel


Pedro Santos

On Mon, Apr 3, 2017 at 10:49 AM, Martijn Dashorst <
martijn.dashorst@gmail.com> wrote:

> While I appreciate the effort in questioning our fundamentals and
> trying to improve even the oldest parts of our API, I don't think that
> the detach method is semantically wrong for models. Semantics are
> defined by what we say the semantics are. In a request/response
> oriented environment a detach is an essential part of the lifecycle of
> a request in general, and for models in particular.
>
> Were Wicket a Swing framework, I would consider modifying the API, but
> as Wicket lives in an environment where the models only live during
> actual request processing, and are literally detached otherwise,
> IModel implementations should have detach behavior, and therefore the
> framework must guarantee that it can call the detach logic at
> appropriate times. Therefore IModels *are* IDetachable.
>
> So I don't think we should remove IDetachable from IModel as it is an
> essential, integral and semantically correct part of models.
>
> [X] No, keep IModel detachable.
>
> Martijn
>
>
> On Mon, Apr 3, 2017 at 9:38 AM, Emond Papegaaij
> <em...@topicus.nl> wrote:
> > Something went wrong sending this mail. I did write some more, but
> somehow my
> > mail client lost it. So here's the vote again:
> >
> > I think we are not going to agree on this proposal. I think it is not an
> > improvement and I do not agree with you that IModel should not be
> > detachable by default. So lets vote on this.
> >
> > [ ] Yes, remove IDetachable from IModel
> > [ ] No, keep IModel detachable
> >
> > My vote:
> > -1 keep IModel detachable
> >
> > Best regards,
> > Emond
> >
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Martijn Dashorst <ma...@gmail.com>.
While I appreciate the effort in questioning our fundamentals and
trying to improve even the oldest parts of our API, I don't think that
the detach method is semantically wrong for models. Semantics are
defined by what we say the semantics are. In a request/response
oriented environment a detach is an essential part of the lifecycle of
a request in general, and for models in particular.

Were Wicket a Swing framework, I would consider modifying the API, but
as Wicket lives in an environment where the models only live during
actual request processing, and are literally detached otherwise,
IModel implementations should have detach behavior, and therefore the
framework must guarantee that it can call the detach logic at
appropriate times. Therefore IModels *are* IDetachable.

So I don't think we should remove IDetachable from IModel as it is an
essential, integral and semantically correct part of models.

[X] No, keep IModel detachable.

Martijn


On Mon, Apr 3, 2017 at 9:38 AM, Emond Papegaaij
<em...@topicus.nl> wrote:
> Something went wrong sending this mail. I did write some more, but somehow my
> mail client lost it. So here's the vote again:
>
> I think we are not going to agree on this proposal. I think it is not an
> improvement and I do not agree with you that IModel should not be
> detachable by default. So lets vote on this.
>
> [ ] Yes, remove IDetachable from IModel
> [ ] No, keep IModel detachable
>
> My vote:
> -1 keep IModel detachable
>
> Best regards,
> Emond
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Sebastien <se...@gmail.com>.
[x] No, keep IModel detachable

Even I understand Pedro's concern, Emond raised one of the most important
point here: detaching is entirely part of the model life-cycle.

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Martin Grigorov <mg...@apache.org>.
[ X ] No, keep IModel detachable

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Apr 3, 2017 at 9:38 AM, Emond Papegaaij <em...@topicus.nl>
wrote:

> Something went wrong sending this mail. I did write some more, but somehow
> my
> mail client lost it. So here's the vote again:
>
> I think we are not going to agree on this proposal. I think it is not an
> improvement and I do not agree with you that IModel should not be
> detachable by default. So lets vote on this.
>
> [ ] Yes, remove IDetachable from IModel
> [ ] No, keep IModel detachable
>
> My vote:
> -1 keep IModel detachable
>
> Best regards,
> Emond
>
>
>

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Carl-Eric Menzel <cm...@wicketbuch.de>.
[X] No, keep IModel detachable

I can see Pedro's point. A Model really is only something that can get
and set. But detaching is such an important part of the lifecycle of
many Wicket things (including Models) that I think it is an acceptable
tradeoff in clarity to have IModel extend IDetachable.

Carl-Eric

Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Sven Meier <sv...@meiers.net>.
[-1] No, keep IModel detachable

Sven


On 03.04.2017 09:38, Emond Papegaaij wrote:
> Something went wrong sending this mail. I did write some more, but somehow my
> mail client lost it. So here's the vote again:
>
> I think we are not going to agree on this proposal. I think it is not an
> improvement and I do not agree with you that IModel should not be
> detachable by default. So lets vote on this.
>
> [ ] Yes, remove IDetachable from IModel
>
>
> My vote:
> -1 keep IModel detachable
>
> Best regards,
> Emond
>
>


Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Emond Papegaaij <em...@topicus.nl>.
Something went wrong sending this mail. I did write some more, but somehow my 
mail client lost it. So here's the vote again:

I think we are not going to agree on this proposal. I think it is not an
improvement and I do not agree with you that IModel should not be
detachable by default. So lets vote on this.

[ ] Yes, remove IDetachable from IModel
[ ] No, keep IModel detachable

My vote:
-1 keep IModel detachable

Best regards,
Emond



Re: [VOTE] Proposal to remove IDetachable from IModel hierarchy

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Apr 3, 2017 at 9:20 AM, Emond Papegaaij <em...@topicus.nl>
wrote:

> TL;DR Vote at the bottom
>
> On zondag 2 april 2017 00:25:12 CEST Pedro Santos wrote:
> > > The major concern I have with this change is that it does not improve
> > > anything. This change has impact on both the calling and implementing
> > > side of detach. Neither side becomes easier.
> >
> > It does improve the IModel interface hierarchy by removing an unnecessary
> > superinterface, and by fixing the code semantic by removing an empty
> method
> > that wasn't default, but was written as one.
>
> I do not agree here, as I see detach as an integral part of the IModel
> lifecycle. But I don't
> think we are going to agree on that.
>
> > > The caller (i.e. component) still always has to call detach on all
> models
> > > (now guared by an instanceof), because it can never be sure that the
> > > actual implementation will or will not be detachable.
> >
> > No, the caller needs to call detach if the model is detachable only.
> >
> > > For example, if the type is MyCustomModel (which does not implement
> > > IDetachable), a subclass of this type might implement IDetachable.
> Also,
> > > the implementation of MyCustomModel might change in the future.
> >
> > You are clearly generalizing a very specific use case, you can't say
> "still
> > always has to call detach". In this specific use case, where you have a
> > polymorphic type, yes you do have to check if the instance is detachable.
> > This occurs in Wicket's core because it's the place where generic model
> > wrappers abstractions are defined and provided for the final user. If
> > Wicket's core abstractions do their job right, this complexity should be
> > taken away from the final user.
>
> Types in Java can always be polymorphic (except when they are final). A
> well written
> component does not depend on the specifics of its models. Therefore a
> component should
> be built on IModels *and* detach these model. That's the only way it will
> work for all types
> of models.
>
> > What do those models have in common? They are all wrappers to other
> models.
> > If we pass through this proposal, we will be able to go ahead and propose
> > to remove their IDetachable interface; that was wrongfully ( and
> > unthoughtful because it was forced via IModel ) add as their
> superinterface.
> >
> > > On the side of the implementation for new models not much changes. You
> > > don't need to implement detach() when you don't need it.
> >
> > No, you *do need*, and you *already implemented* it by choosing to
> > implement IModel. You clearly mean here that you successfully hide from
> > the user an empty method, written with a semantically wrong word,
> enforced
> > by a contract that shouldn't be there in the first place. It's just
> > trickery, not a good interface not enforcing an unneeded method.
>
> What I mean here is that you do not have to write any code.
>
> > > If you do need it, you now
> > > need 2 changes: implement IDetachable *and* implement detach().
> >
> > No, a detachable model *always needed* to implement IDetacheble
> interface,
> > no changes here.
>
> What I mean here is that the author of a model that requires detach() now
> also has to add
> 'implements IDetachable'. This was not needed before, because it was
> inherited from
> IModel.
>
> I think we are not going to agree on this proposal. I think it is not an
> improvement and I do
> not agree with you that IModel should not be detachable by default. So
> lets vote on this.
>
> [ ] Yes, remove IDetachable from IModel



You don't give us any options ;-)