Skip to content

Instantly share code, notes, and snippets.

Last active June 19, 2019 18:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A typical component in DI every approach
public class OderSericeImpl implement OrderService {
private final ShoppingCartService cartService;
private final PricingService pricingService;
private final InventoryService inventoryService;
private final UserSession userSession;
private final TimeProvider timeProvider;
// ... and many more, this list will keep increasing when more requirements added
public OrderService(
ShoppingCartService cartService,
PricingService pricingService,
InventoryService inventoryService,
UserSession userSession,
TimeProvider timeProvider) {
this.cartService = cartService;
this.pricingService = pricingService;
// ....
public CreateOrderResponse createOrder(CreateOrderRequest req) {
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment