Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Remove form in RegistrationService #12

Open
bakura10 opened this issue May 23, 2013 · 3 comments
Open

Remove form in RegistrationService #12

bakura10 opened this issue May 23, 2013 · 3 comments

Comments

@bakura10
Copy link
Contributor

Here: https://github.com/Bacon/BaconUser/blob/master/src/BaconUser/Service/RegistrationService.php#L27

The registration service is tied to a form. I think it's not responsability of the service to do that. The RegistrationService should only receive data considered as valid. When using REST we mostly don't use form but only input filter.

Furthermore, because the form is in the registration form itself, there is no way to retrieve it to show errors.

What do oyu think @Ocramius?

@Ocramius
Copy link
Contributor

@bakura10 agreed - forms are not a service layer concept - that's inputfilters/hydrators.

@DASPRiD
Copy link
Member

DASPRiD commented May 24, 2013

@Ocramius @bakura10 But forms act as facade services for filtering/hydration, see: http://blog.ploeh.dk/2010/02/02/RefactoringtoAggregateServices/

@Ocramius
Copy link
Contributor

The problem with forms is that forms imply a lot more things behind them - they dictate the structure of the output and such, while a simpler JSON/XML REST api is just input-filter | hydrator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants