Skip to content

Instantly share code, notes, and snippets.

@elegantcoder
Last active August 27, 2020 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elegantcoder/c1586fdbe8db9689d8597a9c13c95fc8 to your computer and use it in GitHub Desktop.
Save elegantcoder/c1586fdbe8db9689d8597a9c13c95fc8 to your computer and use it in GitHub Desktop.
[PojoFactoryWithDI] #java #spring
import org.springframework.stereotype.Component;
import lombok.RequiredArgsConstructor;
@Component
@RequiredArgsConstructor
class AFactory {
private final AComponent aComponent;
private final BComponent bComponent;
public APowered createInstance(AEntity aEntity) {
return new APowered(aEntity, aComponent, bComponent);
}
}
@elegantcoder
Copy link
Author

Hello Spring, DI, Java World.

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