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

implemented injector class #709

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DmytroV95
Copy link

No description provided.

public class Injector {
private static final Injector injector = new Injector();

private final Map<Class<?>, Object> instances = new HashMap<>();
private final Map<Class<?>, Class<?>> interfaceImplementations = Map.of(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In common mistakes was a requirement
Make Interface Implementations map a class field.
I think, we need set static type for this map.

Copy link

@IhorKalaur IhorKalaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, some detail need to fix

import mate.academy.service.impl.FileReaderServiceImpl;
import mate.academy.service.impl.ProductParserImpl;
import mate.academy.service.impl.ProductServiceImpl;

public class Injector {
private static final Injector injector = new Injector();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

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.

3 participants