@Inject() I’m a new user of Play Framework, please help with a simple question


@Inject() I’m a new user of Play Framework, please help with a simple question

OK now we got dependency injection. But who's doing the injection and how do they know it's instantiated right. I just add @Inject() next to things and they get magically inserted there by some wizard of code?

How do I add one of my own classes to be injected soemwhere. Specifically, I am replacing Global with a @Singleton class that now has onStart code on the constructor. Where do I now tell the system to inject this shit into the injectee?

Thanks in advance for helping me out with this uncomprehensible black magic.

Submitted August 13, 2017 at 11:18AM by deguinho
via reddit http://ift.tt/2vx81BX

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s