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

CDI/Guice: Make the HostServices injectable. #99

Closed
manuel-mauky opened this issue Jul 29, 2014 · 3 comments
Closed

CDI/Guice: Make the HostServices injectable. #99

manuel-mauky opened this issue Jul 29, 2014 · 3 comments
Assignees
Milestone

Comments

@manuel-mauky
Copy link
Collaborator

In a plain JavaFX application you can get the HostServices instances in the Application class. A typical usecase for HostServices is to open a website in the system web browser.

For CDI and Guice based applications it would be cool to be able to inject the HostServices instance.

@sialcasa
Copy link
Owner

I would not make the hostservices accessable, but the Application it self. An @Inject of the Application would be better or? @lestard

@sialcasa sialcasa reopened this Jul 30, 2014
@manuel-mauky
Copy link
Collaborator Author

Are there any problems with using HostServices outside of the Application class that I have missed?

In respect to the "law of demeter" in my oppinion it's better to directly use the HostServices instead of injecting Application and then use "getHostServices" because I don't care where the HostServices comes from. I don't need the Application but only the HostServices for this usecase.

Besides this, making the Application injectable of cause would be possible too when it is needed for other use cases.

@sialcasa
Copy link
Owner

Agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants