I prefer using some kind of DTO/Command/Backing object that contains all data for a specific action (creation of new items, updates etc):
Code:
class NewPersonCommand{
String firstname,lastname;phoneNumber;
}
The Controller can bind to this object because everything is exposed (maybe getters/setters or just public fields).
In the Service you can do this:
Code:
class NewPersonService{
PersonDao personDao;
@Transactional
Person create(NewPersonCommand command){
Person person = new Person(command.getFirstname(),....)
personDao.insert(person);
return person;
}
}
Transactional boundaries are also 100% clear in this example, something that often is completely unclear when domain objects are exposed in the controller (also possible location for database isolation problems btw... lost update for example).
Using such a command object also depends a little on the application: if there is almost no domain logic... I can imagine that it is a lot of stupid work.