DEV Community

Cover image for Difference between Service and Service Provider
Ahmed Nagi
Ahmed Nagi

Posted on

Difference between Service and Service Provider

This an Interview Question

Image description

👷‍♀️ Service: A class that you pass data to and get something in return or ask to do some work.

⚡ Provider: A class used to bootstrap the service, i.e. prepare it, read some config or bind an implementation.

Code example 👇

Code example

Discussion (2)

Collapse
alphaolomi profile image
Alpha Olomi

Nice explanation , i love the example

Collapse
nagi profile image
Ahmed Nagi Author

Thanks buddy, hope you liked it!