You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Willis Blackburn (JIRA)" <ji...@apache.org> on 2010/12/29 16:09:46 UTC
[jira] Created: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Refactoring of RequestCycle has reintroduced WICKET-689
-------------------------------------------------------
Key: WICKET-3291
URL: https://issues.apache.org/jira/browse/WICKET-3291
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.5-M3
Reporter: Willis Blackburn
Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
See also WIKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willis Blackburn updated WICKET-3291:
-------------------------------------
Description:
Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
See also WICKET-689.
was:
Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
See also WIKET-689.
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975806#action_12975806 ]
Willis Blackburn commented on WICKET-3291:
------------------------------------------
In case you're wondering what the use case is: my application figures out some information at the beginning of the request and stores it in its custom RequestCycle implementation so that it can use it later in the request. It uses RequestCycle in the same way it uses Session, only for request-level information rather than session-level.
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975796#action_12975796 ]
Martin Grigorov commented on WICKET-3291:
-----------------------------------------
There is org.apache.wicket.Application.setRequestCycleProvider(IRequestCycleProvider) where you define the custom provider.
IProvider is used for many other settings too and it is easier to setup one provider and later change it.
Does this solve your problem ?
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-3291.
-----------------------------------
Resolution: Invalid
Assignee: Igor Vaynberg
the indirection was necessary because there are usecases where an applicaiton subclass is not possible. for example, wicket tester in 1.5 needs to decorate the request cycle used by the application - it cannot do this if there was simply a newRequestCycle() method, but it can by decorating the provider. see BaseWicketTester$TestRequestCycleProvider class in trunk.
further, while the factory methods are simpler the providers are necessary because class hieararchy is not flexible. since there is no multiple inheritance people cannot mix two application base classes that provide functionality. by switching to providers and letting code push changes into the application instead of pulling from factory methods we allow much more flexibility for wicket libraries. for example a spring library can push a component instantiation listener while a security library can push an authorization strategy by using providers instead of factory methods.
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
> Assignee: Igor Vaynberg
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975809#action_12975809 ]
Willis Blackburn commented on WICKET-3291:
------------------------------------------
I want to add: A pluggable IRequestCycleProvider class would make sense if Wicket applications didn't normally subclass Application. But in fact *every* Wicket application subclasses Application. It's required in order to set the home page. So IRequestCycleProvider merely requires application developers to implement another interface and then invoke a setter on Application, without freeing them from the necessity of subclassing Application. The change will break 1.4 code, and while I think that it's fine to break existing code in the interest of improving the framework, in this case, there doesn't seem to be an offsetting benefit to the change.
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975800#action_12975800 ]
Willis Blackburn commented on WICKET-3291:
------------------------------------------
Martin--thanks for your response.
It doesn't resolve the issue. I know about IRequestCycleProvider (I mentioned it in the description above).
The issue is that it's unnecessarily complicated to create a custom request cycle. It is *easy* to create custom session--just override newSession. The point that I made in my earlier issue (WICKET-689) is that it can and should be just as easy to create a new request cycle.
In earlier versions of Wicket, it was *possible* to create a custom request cycle; it just took some extra work. When I raised that point 3 years ago, the team agreed and replaced the factory interface with the method newRequestCycle. In fact if you look at the 1.4 branch, you'll see it there, and you'll also see that the IRequestCycleFactory method is deprecated.
The change made sense then, and it's made sense for over 3 years, so why change it back to the way it was before?
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3291) Refactoring of RequestCycle has
reintroduced WICKET-689
Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975825#action_12975825 ]
Willis Blackburn commented on WICKET-3291:
------------------------------------------
I think that the same argument goes for sessionStoreProvider. Why not just have a method: newSessionStore? Or getSessionStore, if it's supposed to return the same one each time?
And also:
pageRendererProvider: The code only ever retrieves it in order to call get; why not just have getPageRenderer or newPageRenderer?
converterLocator: How about just getConverter?
> Refactoring of RequestCycle has reintroduced WICKET-689
> -------------------------------------------------------
>
> Key: WICKET-3291
> URL: https://issues.apache.org/jira/browse/WICKET-3291
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Reporter: Willis Blackburn
>
> Three years ago I requested a newRequestCycle method in Application to make it as easy to integrate custom RequestCycle implementations as it is to integrate custom Session implementations. The Wicket team added the method and also removed the IRequestCycleFactory interface.
> But in the 1.5-M3 code base I see the exact same situation: IRequestCycleFactory has returned, only now it's called IRequestCycleProvider, and again there is no non-final Application method that I can override to instantiate my own RequestCycle.
> I think as a general principle, we should look skeptically at interfaces have one method and that only exist as a member of one class and are only called from that class; it seems like a complicated way of overriding a method. Possibly there's a Wicket application out there somewhere that would benefit from the interface. But for most of us, who are creating our own Application subclasses anyway, it's much easier to just override newRequestCycle, in the same way that we override newSession.
> See also WICKET-689.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.