Hi,
I am reading a book about EJB3.0 which has been very helpful to me so far. However I now find myself in a dilemma which is not clearly covered in the book and I would really like to know how best to proceed. In the book it says that an Entity Manager wrapper class (responsible to handle all CRUD operations for a particular object) can have several methods. One of the methods it describes is as follows;
addUser(String username, String password, String name, String surname, etc){ ... }
Note that in the above method the book does not pass the
User object as a parameter to the method but rather the attributes of the
User object. Therefore my first question is this;
Is there any benefit / drawback in writing the
addUser(...) method in this way? or it is better to write it as follows;
addUser(User user){ ... }