DEV Community

Cover image for A Look Under the Hood of AdonisJS [Part 2] - Service Providers
Patrick O'Dacre
Patrick O'Dacre

Posted on • Updated on

A Look Under the Hood of AdonisJS [Part 2] - Service Providers

Subscribe to my YouTube channel for more tutorials on working with VueJS and AdonisJS -- an MVC framework for NodeJS!

Follow along as I explore Service Providers in AdonisJS.

Service Providers are how we add instructions for new objects to our IoC Container.

Together we'll cover each section of the docs and go through the source code to see how they actually work.

We'll look at the ViewProvider and AppProvider, as well as the Config class and how it helps us manage our object configuration.


In part 1 of this series, we took an in-depth look at the IoC Container. If you didn't watch that video, be sure to watch it first!

By the end of these videos, you'll have a firm grasp on how the IoC Container and Service Providers do their jobs, and just how helpful they are.

Top comments (3)

Collapse
 
skyrpex profile image
Cristian Pallarés

You can almost point out to Laravel docs! I love how it works.

I made a framework like AdonisJS not so long ago, but I used typescript. Not sure if the service provider pattern is gonna be adopted by JS apps anytime soon, but I'd certainly join.

Collapse
 
patrickodacre profile image
Patrick O'Dacre

For sure!

Before I knew about Adonis I longed for a Laravel-like solution for Node. I think the service provider pattern would be adopted by many more people as they get experience with it. It's such a great way to manage dependencies; it's clean and easy to understand.

Thanks for the comment. Keep an eye out for upcoming videos. I'm working on some more advanced tuts on Lucid and the Query Builder. If you know Eloquent, you'll feel right at home ;)

Collapse
 
jamols09 profile image
jamols09

Is the service provider is where the business logic occurs just like on laravel (service-repository pattern)