I'm working with JEE standard. I have the following layers: JPA (Eclipse Link), Data Access, Business Logic, and JSF (Primefaces). Primefaces uses MVC design pattern, so the the presentation layer contains the ManagedBeans (controllers).
When I create an object from an user request, must I contruct the object in the ManagedBean and pass it as the whole object to the logic, or should I pass the attributes of that object to the logic:
public void businessLogicMethod(String clientAttributeA, int clientAttributeB...)
or
public void businessLogicMethod(Client client)
I really can't make up my mind. Functionally, both options do the same... But are there any software quality advantages from one to the other? Is there any layer design reason to construct it in the controller or the model? Is there any other reason?
One of the advantages I see in the upper one is that the deployment diagram's services will have the parameters declared in the service interfaces, so there is much more information in the diagram.