What do you think of the best way to implement JSF 2.0 beans managed methods, such as:
public FacesContext getFacesContext() { return FacesContext.getCurrentInstance(); } public Flash getFlash() { return getFacesContext().getExternalContext().getFlash(); } public void addMessage(String clientId, String message) { FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, message, message); getFacesContext().addMessage(clientId, facesMessage); }
I think either as an abstract class, or as a regular class with static methods.
My understanding is that the object resulting from the extension of the classes will consume more memory, but most (almost all) of them are the request area, which has the right to garbage collection as soon as the answer is received.
I am interested in the best OO design and minimal taxation for the server. Thanks
source share