package has_a_relationship;

public class ComputerTest {

	public static void main(String[] args) {
		/* constructor injection, aggregation */
		CPU cpu = new CPU(1000);
		Memory memory = new Memory(32);
		Computer computer = new Computer(cpu, memory);
		
		System.out.println(cpu);
		System.out.println(memory);
		System.out.println(computer);
		
		
		System.out.println();
		
		/* setter injection, optional, aggregation  */ 
		CPU cpu2 = new CPU(1000);
		Memory memory2 = new Memory(32);
		Computer computer2 = new Computer();
		
		computer2.setCpu(cpu2);
		computer2.setMemory(memory2);
		
		System.out.println(cpu2);
		System.out.println(memory2);
		System.out.println(computer2);	
	}
}