// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/InventoryService.java
// @Service
// public class InventoryService {
// 
//     private final ItemRepository itemRepository;
//     private final PersonRepository personRepository;
// 
//     @Autowired
//     public InventoryService(ItemRepository itemRepository, PersonRepository personRepository){
//         super();
//         this.itemRepository = itemRepository;
//         this.personRepository = personRepository;
//     }
// 
//     public Inventory getInventory(long personId){
//         return new Inventory();
//     }
// 
//     public Inventory updateInventory(Inventory inventory){
//         return inventory;
//     }
// 
//     public DetailedInventoryItem getDetailedInventoryItem(long personId, long itemId){
//         return new DetailedInventoryItem();
//     }
// 
// }
// 
// Path: code/exercise_4/exercise/src/main/java/com/frankmoley/talks/spring/intro/service/UserService.java
// @Service
// public class UserService {
// 
//     private final PersonRepository personRepository;
// 
//     @Autowired
//     public UserService(PersonRepository personRepository){
//         super();
//         this.personRepository = personRepository;
//     }
// 
//     @Loggable
//     public User getUser(String emailAddress){
//         User user = new User();
//         user.setUsername("BigLebowski");
//         user.setPersonId(UUID.randomUUID().toString());
//         return user;
//     }
// }


import com.frankmoley.talks.spring.intro.service.InventoryService;
import com.frankmoley.talks.spring.intro.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
package com.frankmoley.talks.spring.intro.config;


@Configuration
@PropertySource("classpath:application.properties")
@EnableAspectJAutoProxy
@ComponentScan(basePackages = {"com.frankmoley.talks.spring.intro"})
public class ApplicationConfig {

   @Autowired
   private Environment environment;


    public static void main(String[] args){
        ApplicationContext context = new  AnnotationConfigApplicationContext(ApplicationConfig.class);
        InventoryService service = context.getBean(InventoryService.class);
// Path: code/exercise_4/solution/src/main/java/com/frankmoley/talks/spring/intro/service/InventoryService.java
// @Service
// public class InventoryService {
// 
//     private final ItemRepository itemRepository;
//     private final PersonRepository personRepository;
// 
//     @Autowired
//     public InventoryService(ItemRepository itemRepository, PersonRepository personRepository){
//         super();
//         this.itemRepository = itemRepository;
//         this.personRepository = personRepository;
//     }
// 
//     public Inventory getInventory(long personId){
//         return new Inventory();
//     }
// 
//     public Inventory updateInventory(Inventory inventory){
//         return inventory;
//     }
// 
//     public DetailedInventoryItem getDetailedInventoryItem(long personId, long itemId){
//         return new DetailedInventoryItem();
//     }
// 
// }
// 
// Path: code/exercise_4/exercise/src/main/java/com/frankmoley/talks/spring/intro/service/UserService.java
// @Service
// public class UserService {
// 
//     private final PersonRepository personRepository;
// 
//     @Autowired
//     public UserService(PersonRepository personRepository){
//         super();
//         this.personRepository = personRepository;
//     }
// 
//     @Loggable
//     public User getUser(String emailAddress){
//         User user = new User();
//         user.setUsername("BigLebowski");
//         user.setPersonId(UUID.randomUUID().toString());
//         return user;
//     }
// }


// Path: code/exercise_3/exercise/src/main/java/com/frankmoley/talks/spring/intro/config/ApplicationConfig.java
import com.frankmoley.talks.spring.intro.service.InventoryService;
import com.frankmoley.talks.spring.intro.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

package com.frankmoley.talks.spring.intro.config;


@Configuration
@PropertySource("classpath:application.properties")
@EnableAspectJAutoProxy
@ComponentScan(basePackages = {"com.frankmoley.talks.spring.intro"})
public class ApplicationConfig {

   @Autowired
   private Environment environment;


    public static void main(String[] args){
        ApplicationContext context = new  AnnotationConfigApplicationContext(ApplicationConfig.class);
        InventoryService service = context.getBean(InventoryService.class);
        UserService userService = context.getBean(UserService.class);