GenericRenderers
GenericRenderers copied to clipboard
Avoid Renderer cloning by reusing given instance
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