2013/10/21 Vineet Reynolds Pereira <vpereira@redhat.com>


IMHO we should not be putting persistence concerns in either the JSF beans or the REST resources.
They should go into a service or a repository or whatever data access pattern is suitable for the context.
This is where we lack any standardization at the moment, and it would be better to not limit this exercise to improving the conventions alone, but also the architecture.


Vineet, this is the topic I'm writing about at the moment. To be honest, I quite like to have persistent concerns in JSF beans and REST for certain projects... but not all, and that's where I thing Forge should give some choices. What I'm writing is about having 3 different architectural styles that could be resume like this (using CLI) : 

Current (generates JSF/REST from entities) :
jsf-scaffold-from-entity
rest-scaffold-from-entity

EJB Centric (add a service layer to deal with persistence) :
ejb-scaffold-from-entity 
jsf-scaffold-from-ejb
rest-scaffold-from-ejb

REST centric (the JSF backing beans use the REST endpoint, using JAX-RS 2.0 Client API) :
rest-scaffold-from-entity
jsf-scaffold-from-rest


I will let you know when the post is written, it will be clearer

--
Antonio Goncalves 
Software architect and Java Champion

Web site | Twitter | LinkedIn | Paris JUG | Devoxx France