You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2016/04/05 10:48:25 UTC

[jira] [Updated] (WICKET-6137) ListenerInterfaceRequestHandler simplification

     [ https://issues.apache.org/jira/browse/WICKET-6137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier updated WICKET-6137:
-------------------------------
    Description: 
Branch "request_listener_simplification" contains a proposal to simplify ListenerInterfaceRequestHandler.

By limiting components and behaviors to implement a single callback only, we can remove the identifying part "I*Listener" from URLs.
For page 0, renderCount 1 and behavior 2 the following componentInfos:

  0-1.ILinkListener-link
  0-1.ILinkListener.2-link
  0-IResourceListener-image
  0-IResourceListener.2-wmc

... become:

  0-1.-link
  0-1.2-link
  0--image
  0-.2-wmc

This format could be further improved, suggestions are welcomed.

This has the following advantages:
- framework exposure in URLs is minimized
- URLs get shorter
- no need to register INTERFACE constants any longer
- instead using of reflection ListenerInterfaceRequestHandler can call a single method on the component or behavior, which makes debugging easier.
- a single interface for components or behavior is enough to be targeted by requests:

{code}
	public interface IRequestListener extends IClusterable
	{

		/**
		 * Does invocation of this listener render the page. 
		 * 
		 * @return default {@code true}, i.e. a {@link RenderPageRequestHandler} is scheduled after invocation 
		 */
		default boolean rendersPage()
		{
			return true;
		}
	
		/**
		 * Called when a request is received.
		 */
		void onRequest();
	}
{code}

  was:
Branch "request_listener_simplification" contains a proposal to simplify ListenerInterfaceRequestHandler.

By limiting components and behaviors to implement a single callback only, we can remove the identifying part "I*Listener" from URLs.
For page 0, renderCount 1 and behavior 2 the following componentInfos:

  0-1.ILinkListener-link
  0-1.ILinkListener.2-link
  0-IResourceListener-image
  0-IResourceListener.2-wmc

... become:

  0-1.-link
  0-1.2-link
  0-.-image
  0-.2-wmc

This format could be further improved.

This has the following advantages:
- minimize framework exposure in URLs
- URLs get shorter
- no need to register INTERFACE constants any longer
- instead using of reflection ListenerInterfaceRequestHandler can call a single method on the component or behavior, which makes debugging easier.
- single interface for components or behavior which can be targetted by requests:

{code}
	public interface IRequestListener extends IClusterable
	{

		/**
		 * Does invocation of this listener render the page. 
		 * 
		 * @return default {@code true}, i.e. a {@link RenderPageRequestHandler} is scheduled after invocation 
		 */
		default boolean rendersPage()
		{
			return true;
		}
	
		/**
		 * Called when a request is received.
		 */
		void onRequest();
	}
{code}

        Summary: ListenerInterfaceRequestHandler simplification  (was: ListenerInterfaceRequestHandler )

> ListenerInterfaceRequestHandler simplification
> ----------------------------------------------
>
>                 Key: WICKET-6137
>                 URL: https://issues.apache.org/jira/browse/WICKET-6137
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 8.0.0-M1
>            Reporter: Sven Meier
>            Assignee: Sven Meier
>            Priority: Minor
>
> Branch "request_listener_simplification" contains a proposal to simplify ListenerInterfaceRequestHandler.
> By limiting components and behaviors to implement a single callback only, we can remove the identifying part "I*Listener" from URLs.
> For page 0, renderCount 1 and behavior 2 the following componentInfos:
>   0-1.ILinkListener-link
>   0-1.ILinkListener.2-link
>   0-IResourceListener-image
>   0-IResourceListener.2-wmc
> ... become:
>   0-1.-link
>   0-1.2-link
>   0--image
>   0-.2-wmc
> This format could be further improved, suggestions are welcomed.
> This has the following advantages:
> - framework exposure in URLs is minimized
> - URLs get shorter
> - no need to register INTERFACE constants any longer
> - instead using of reflection ListenerInterfaceRequestHandler can call a single method on the component or behavior, which makes debugging easier.
> - a single interface for components or behavior is enough to be targeted by requests:
> {code}
> 	public interface IRequestListener extends IClusterable
> 	{
> 		/**
> 		 * Does invocation of this listener render the page. 
> 		 * 
> 		 * @return default {@code true}, i.e. a {@link RenderPageRequestHandler} is scheduled after invocation 
> 		 */
> 		default boolean rendersPage()
> 		{
> 			return true;
> 		}
> 	
> 		/**
> 		 * Called when a request is received.
> 		 */
> 		void onRequest();
> 	}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)