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

Communication between services #6

Open
theobouwman opened this issue Oct 3, 2018 · 3 comments
Open

Communication between services #6

theobouwman opened this issue Oct 3, 2018 · 3 comments

Comments

@theobouwman
Copy link

I need some hel here.

For a new project I'm using the service pattern. I'm at the point now where I want the auth/user service to add a policy (set of rules) to a user.
Should I make a policy service and pass that to the auth/user service, or should I pass the policy repository to the auth/user service?

Thanks in advance.

@palvarezcordoba
Copy link

I think the you should pass the service, not the repository.
Important: auth/user should depend upon a interface, not the implementation of PolicyService.

@theobouwman
Copy link
Author

Okay, so passing a service to another service as dependency is not against the design pattern?

@palvarezcordoba
Copy link

I don't see how it breaks rules of service pattern. Again, auth/user should use an interface not implementation.

And maybe you could simply do a Policy model and use it.

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

2 participants