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

Defining a service the Spring way. #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vdumitrescu
Copy link

If we define the VideoFileManager as a @service, Spring will instantiate an instance during the application startup, and this can easily be referred from other classes using @Autowired:

@Autowired private VideoFileManager videoFileManager;

No need to implement a Singleton pattern, as Spring IoC will do it for us.

@juleswhite
Copy link
Owner

This is a nice enhancement. I don't cover @service in the course (although this would be nice to add), so I don't want to add this to the assignment and potentially confuse people. Also, we want to freeze the assignment and only apply bug fixes or README clarifications at this point. I do like this change, so I will merge it in for the next version of the course and update the lectures to cover dependency injection and @service before the first assignment.

@juleswhite
Copy link
Owner

I went ahead and updated one of the lectures to mention @service. I am still going to wait to merge this pull request until the end of the class. Not including this in the assignment will allow people to discover on their own that they can either add @service or incorporate it into the Application as an @bean method.

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

Successfully merging this pull request may close these issues.

2 participants