
스프링 핵심 원리 (2)

·
Spring
새로운 할인 정책 개발- 고정 할인이 아닌 정률 할인으로 구매 금액의 10%를 할인으로 변경 정률 할인 클래스package hello.core.discount;import hello.core.member.Grade;import hello.core.member.Member;public class RateDiscountPolicy implements DiscountPolicy { private int discountPercent = 10; @Override public int discount(Member member, int price) { if (member.getGrade() == Grade.VIP) { return price * discountPercen..