[
https://issues.apache.org/jira/browse/WICKET-4201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853108#comment-15853108
]
Pedro Santos commented on WICKET-4201:
--------------------------------------
@Emond
The code implementation had a few problems like unnecessary variables, e.g.
'freshCreated' and 'page'; some duplicated code like
isNewPageInstance/hasPageInstance implementations; plus a spreaded page
resolution logic.
I removed the PageExpiredException from PageProvider since it breaks the class
coherence. It's designed to provide pages and related metadata (such as if the
page was expired included), not to change the application flow on application
exceptions.
After cleaning it up, I have a few suggestions:
- to rename isPageInstanceFresh to doesProvideNewPage (as in the improvement
branch)
- to remove isNewPageInstance since it's just a mirror of hasPageInstance
[~bitstorm]
If IPageSource/IPageManager did offer an API allowing a to get pages without to
touch them (we can work on it), it would enable the PageProvider to bypass the
touch. It doesn't sound an PageProvider limitation to me.
@team
I pushed the improvement to WICKET-4201-improved-page-provider branch, you can
check it out at [1]
1 - https://github.com/apache/wicket/tree/WICKET-4201-improved-page-provider
> IPageProvider and its implementations need to be improved
> ---------------------------------------------------------
>
> Key: WICKET-4201
> URL: https://issues.apache.org/jira/browse/WICKET-4201
> Project: Wicket
> Issue Type: Task
> Components: wicket
> Affects Versions: 1.5.0, 1.5.1, 1.5.2
> Reporter: Emond Papegaaij
> Assignee: Pedro Santos
>
> During the development op 1.5, IPageProvider and its implementations have
> become a bit of a mess. The interface is not clearly defined. One of the
> biggest problems is that several methods can throw exceptions and there is no
> way of knowing which method will throw which exception and when. It should
> always be clear what exceptions to expect. For example, getPage can throw a
> PageExpiredException, but getPageClass cannot, it should return null if no
> page class is set. Perhaps, it's even better to never throw exceptions at
> all. Also, the various introspection methods are not very well defined and
> make it almost impossible to come up with an alternative implementation of
> the interface (which, IMHO is a sign of a broken API).
> Changing this interface is not an option for 1.5, but looking at the number
> of subtle bugs that came from this part of the code, it should really be
> considered for wicket.next.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)