How do people create their service level interfaces?
I program a large web application (in PHP), and we use MVC and program thin controllers, for example. (pseudo code follows)
public savePersonAction() { $input = filter($_GET); ... input validation ... $result = $this->_service->savePerson( ? ); ... etc }
Should savePerson in a service accept an argument to the entire structure or input context of $ (in PHP, an associative array)?
eg. this is -
public function savePerson(array $input) {
or you should select all input fields and provide a "hard" interface, for example.
public function savePerson($title, $firstName, $lastName, $dateOfBirth, ... etc.. for many more) {
Thanks.
Floor
php web-applications model-view-controller service service-layer
Paul hanssen
source share