[ https://issues.apache.org/jira/browse/WICKET-6550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16444748#comment-16444748 ]
ASF GitHub Bot commented on WICKET-6550: ---------------------------------------- Github user Jezza commented on a diff in the pull request: https://github.com/apache/wicket/pull/276#discussion_r182876140 --- Diff: wicket-core/src/main/java/org/apache/wicket/IMetadataContext.java --- @@ -0,0 +1,10 @@ +package org.apache.wicket; + +/** + * @author Jezza + */ +public interface IMetadataContext<B, R> { --- End diff -- I don't like the names of the generics, nor the R parameter. It was only added because the current implementation returns the object the method is enclosed in, so right now, it just conveys that type information. Ideally, I would want to remove it. One solution would be just to return the IMetadataContext<B> itself, but you wouldn't be able to do much with the return result, short of just setting more metadata. > Unify all metadata capable objects. > ----------------------------------- > > Key: WICKET-6550 > URL: https://issues.apache.org/jira/browse/WICKET-6550 > Project: Wicket > Issue Type: Improvement > Components: wicket > Reporter: Jezza > Priority: Minor > Attachments: Test.java, mock.txt > > > Application, Session, RequestCycle, and Component all have #setMetadata and > #getMetadata methods, but lack some super object to unify them all. > These leads to annoying complex code if you wish to implement some basic > functionality. > Such as a computeIfAbsent, which needs to be implemented 4 times. > I propose that we unify them all with one interface. > I'veĀ attached a mock idea that would solve it, and I'll work on a prototype > and submit a PR so anyone can take a look. > I'll add a comment here with the PR number. -- This message was sent by Atlassian JIRA (v7.6.3#76005)