// Path: app/src/main/java/de/czyrux/store/inject/DefaultDependenciesFactory.java
// public class DefaultDependenciesFactory implements DependenciesFactory {
// 
//     private final DataDependenciesFactory dataDependenciesFactory;
//     private final CartStore cartStore;
// 
//     public DefaultDependenciesFactory(DataDependenciesFactory dataDependenciesFactory) {
//         this.dataDependenciesFactory = dataDependenciesFactory;
//         cartStore = new CartStore();
//     }
// 
//     @Override
//     public CartService createCartService() {
//         return new CartService(dataDependenciesFactory.createCartDataSource(), cartStore);
//     }
// 
//     @Override
//     public ProductService createProductService() {
//         return new ProductService(dataDependenciesFactory.createProductDataSource());
//     }
// 
//     @Override
//     public CartStore createCartStore() {
//         return cartStore;
//     }
// }
// 
// Path: app/src/main/java/de/czyrux/store/inject/InMemoryDataDependenciesFactory.java
// public class InMemoryDataDependenciesFactory implements DataDependenciesFactory {
// 
//     private final TimeDelayer timeDelayer;
// 
//     public InMemoryDataDependenciesFactory() {
//         timeDelayer = new TimeDelayer();
//     }
// 
//     @Override
//     public CartDataSource createCartDataSource() {
//         return new InMemoryCartDataSource(timeDelayer);
//     }
// 
//     @Override
//     public ProductDataSource createProductDataSource() {
//         return new InMemoryProductDataSource(timeDelayer);
//     }
// }
// 
// Path: app/src/main/java/de/czyrux/store/inject/Injector.java
// public class Injector {
//     private static Injector INSTANCE;
//     private final CartService cartService;
//     private final ProductService productService;
//     private final CartStore cartStore;
// 
//     private Injector(CartService cartService, ProductService productService, CartStore cartStore) {
//         this.cartService = cartService;
//         this.productService = productService;
//         this.cartStore = cartStore;
//     }
// 
//     public static void using(DependenciesFactory factory) {
//         CartService cartService = factory.createCartService();
//         ProductService productService = factory.createProductService();
//         CartStore cartStore = factory.createCartStore();
//         INSTANCE = new Injector(cartService, productService, cartStore);
//     }
// 
//     private static Injector instance() {
//         if (INSTANCE == null) {
//             throw new IllegalStateException("You need to setup Inject to use a valid DependenciesFactory");
//         }
//         return INSTANCE;
//     }
// 
//     public static CartService cartService() { return instance().cartService; }
// 
//     public static ProductService productService() { return instance().productService; }
// 
//     public static CartStore cartStore() {
//         return instance().cartStore;
//     }
// }


import android.app.Application;
import de.czyrux.store.inject.DefaultDependenciesFactory;
import de.czyrux.store.inject.InMemoryDataDependenciesFactory;
import de.czyrux.store.inject.Injector;
package de.czyrux.store.ui;



public class GroceryStoreApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
// Path: app/src/main/java/de/czyrux/store/inject/DefaultDependenciesFactory.java
// public class DefaultDependenciesFactory implements DependenciesFactory {
// 
//     private final DataDependenciesFactory dataDependenciesFactory;
//     private final CartStore cartStore;
// 
//     public DefaultDependenciesFactory(DataDependenciesFactory dataDependenciesFactory) {
//         this.dataDependenciesFactory = dataDependenciesFactory;
//         cartStore = new CartStore();
//     }
// 
//     @Override
//     public CartService createCartService() {
//         return new CartService(dataDependenciesFactory.createCartDataSource(), cartStore);
//     }
// 
//     @Override
//     public ProductService createProductService() {
//         return new ProductService(dataDependenciesFactory.createProductDataSource());
//     }
// 
//     @Override
//     public CartStore createCartStore() {
//         return cartStore;
//     }
// }
// 
// Path: app/src/main/java/de/czyrux/store/inject/InMemoryDataDependenciesFactory.java
// public class InMemoryDataDependenciesFactory implements DataDependenciesFactory {
// 
//     private final TimeDelayer timeDelayer;
// 
//     public InMemoryDataDependenciesFactory() {
//         timeDelayer = new TimeDelayer();
//     }
// 
//     @Override
//     public CartDataSource createCartDataSource() {
//         return new InMemoryCartDataSource(timeDelayer);
//     }
// 
//     @Override
//     public ProductDataSource createProductDataSource() {
//         return new InMemoryProductDataSource(timeDelayer);
//     }
// }
// 
// Path: app/src/main/java/de/czyrux/store/inject/Injector.java
// public class Injector {
//     private static Injector INSTANCE;
//     private final CartService cartService;
//     private final ProductService productService;
//     private final CartStore cartStore;
// 
//     private Injector(CartService cartService, ProductService productService, CartStore cartStore) {
//         this.cartService = cartService;
//         this.productService = productService;
//         this.cartStore = cartStore;
//     }
// 
//     public static void using(DependenciesFactory factory) {
//         CartService cartService = factory.createCartService();
//         ProductService productService = factory.createProductService();
//         CartStore cartStore = factory.createCartStore();
//         INSTANCE = new Injector(cartService, productService, cartStore);
//     }
// 
//     private static Injector instance() {
//         if (INSTANCE == null) {
//             throw new IllegalStateException("You need to setup Inject to use a valid DependenciesFactory");
//         }
//         return INSTANCE;
//     }
// 
//     public static CartService cartService() { return instance().cartService; }
// 
//     public static ProductService productService() { return instance().productService; }
// 
//     public static CartStore cartStore() {
//         return instance().cartStore;
//     }
// }


// Path: app/src/main/java/de/czyrux/store/ui/GroceryStoreApp.java
import android.app.Application;
import de.czyrux.store.inject.DefaultDependenciesFactory;
import de.czyrux.store.inject.InMemoryDataDependenciesFactory;
import de.czyrux.store.inject.Injector;

package de.czyrux.store.ui;



public class GroceryStoreApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Injector.using(new DefaultDependenciesFactory(new InMemoryDataDependenciesFactory()));