-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStockApp.java
More file actions
25 lines (21 loc) · 942 Bytes
/
StockApp.java
File metadata and controls
25 lines (21 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package stock;
import stock.observer.Customer;
import stock.observer.StockCustomer;
import stock.stocks.repository.StocksRepository;
import stock.subject.Brokerage;
import stock.subject.SamsungBrokerage;
public class StockApp {
public static void main(String[] args) {
Brokerage brokerage = new SamsungBrokerage();
StockCustomer customer1 = new Customer("김봉팔");
StockCustomer customer2 = new Customer("김사지");
customer1.addStocks(StocksRepository.STOCKS_MAP.get("Kakao"));
customer1.addStocks(StocksRepository.STOCKS_MAP.get("Samsung"));
customer2.addStocks(StocksRepository.STOCKS_MAP.get("Kakao"));
customer2.addStocks(StocksRepository.STOCKS_MAP.get("Samsung"));
customer2.addStocks(StocksRepository.STOCKS_MAP.get("Tesla"));
brokerage.addCustomer(customer1);
brokerage.addCustomer(customer2);
brokerage.notifyToCustomer();
}
}