Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] First class user domain recipe #392

Closed
ro0NL opened this issue Mar 24, 2018 · 2 comments
Closed

[RFC] First class user domain recipe #392

ro0NL opened this issue Mar 24, 2018 · 2 comments

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Mar 24, 2018

Hi,

I might be dropping a bombshell here. #imgoingforitanyway

I'm proposing composer require user (or a to be discussed first-class alias), based on https://github.com/msgphp/user-bundle. Its current recipe lives at https://github.com/symfony/recipes-contrib/tree/master/msgphp/user-bundle/0.2

It's a domain layer only! No controllers, templates, translations or any other potential override hassle / application tailored code. It comes with many infrastructural code what i tend to believe is industry standard these days; That is doctrine, elasticssearch, api platform, uuid, security, oauth, message bus etc. Lots of 2018 goodies :)

A full demo is maintained at https://github.com/msgphp/symfony-demo-app, moreover I think it's ready enough to be considered a FOSUserBundle replacement for basic operations. I'm committed to the project and aiming for a 1.0 release eventually, but that also requires real usage / gaining a community. Hence this is my next move :)

The opinionated part and most noticeable when working with the bundle is a base entity that defines User::getId(): UserIdInterface. It's based on identifier value objects by design and abstract base classes (e.g. doctrine mapped super classes).

The rest is practically up to decide by the end user, at application level. I tend to believe i properly solved a lot of issues mentioned in e.g. https://jolicode.github.io/fosuserbundle-conf/#/

Last but not least i consider the application design an educational effort as well. Docs are top prio! https://msgphp.github.io/docs/ Yet i cannot deny one might qualify it "advanced stuf", however the goal is to teach and simplify those patterns. In general im preparing the first cookbook topics now: see msgphp/msgphp#115 for my list.

@ro0NL
Copy link
Contributor Author

ro0NL commented Mar 24, 2018

About the name "Message driven PHP"; i started this project to solve a simple

$bus->dispatch(new CreateUserCommand(['email' => $email, 'password' => $password]);

I like the messenger pattern, but it's optional. You can still work with e.g. Doctrine directly if that's what you're used to. Yet this is about separating concerns, entity state, decoupling, etc.

Eventually i created some form of abstraction model, to be applied on other domains as well (e.g. a file domain, taxonomy domain, your custom domain, etc. Common CMS stuff :P). And here we are...

@ro0NL ro0NL changed the title First class user domain recipe [RFC] First class user domain recipe Mar 24, 2018
@ro0NL
Copy link
Contributor Author

ro0NL commented Mar 26, 2018

I have some more thoughts how this could work even better, see msgphp/symfony-demo-app#38

@ro0NL ro0NL closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant