-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
30 lines (25 loc) · 967 Bytes
/
Main.java
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
26
27
28
29
30
import DIP.Controller.UserController;
import DIP.Repository.UserRepository;
import DIP.Service.UserService;
import OCP.Animals;
import OCP.Lion;
import OCP.Snake;
import OCP.Interface.Animal;
import SRP.*;
import SRP.ValueObject.*;
class Main{
public static void main(String[] args) {
RegularPrice bookPrice = new RegularPrice(500);
System.out.println(bookPrice.amount);
RegularDiscountedPrice bookDiscountedPrice = new RegularDiscountedPrice(bookPrice);
System.out.println(bookDiscountedPrice.amount);
SummerDiscountedPrice summerBookDiscountedPrice = new SummerDiscountedPrice(bookPrice);
System.out.println(summerBookDiscountedPrice.amount);
Animal animals[] = {new Lion(), new Snake()};
Animals.animalsSounds(animals);
UserRepository repo = new UserRepository();
UserService service = new UserService(repo);
UserController controller = new UserController(service);
System.out.println(controller.get());
}
}