GenericRenderers icon indicating copy to clipboard operation
GenericRenderers copied to clipboard

Avoid Renderer cloning by reusing given instance

Open aballano opened this issue 9 years ago • 0 comments

Right now the RendererBuilder binding is done by passing an instance of a Renderer which will later on be cloned in order to be reused.

This causes that any state my Renderer could have is actually lost (imagine for example that I would like to count how many times I've rendered an item) unless clone() is properly implemented, which is not enforced and therefore just forgotten.

Update: An idea would be to have two different state options:

  • Statefull: Just like it works now, by providing a specific Renderer instance to the RendererBuilder.
  • Stateless: This could be achieved by providing a RenderFactory to the RendererBuilder.

Related to #9

aballano avatar Feb 03 '17 12:02 aballano