?????????????????????????????????Part ?????????
       ?????????·????????PricePolicy???????????м??????????????????????????????????????????????????????????????????????
    public class Part {     
           private PricePolicy pricePolicy;     
           public void setPricePolicy(PricePolicy policy) {     
               pricePolicy = policy;     
           }     
           public void setPrice(double price) {     
               pricePolicy.setPrice(price);     
           }     
           public double getPrice() {     
               return pricePolicy.getPrice();     
           }     
    }     
    public class PricePolicy {     
           private double basePrice;     
           public void setPrice(double price) {     
               basePrice = price;     
           }     
           public double getPrice() {     
               return basePrice;     
           }     
    }        
    public class SalePrice extends PricePolicy {     
           private double discount;     
           public void setDiscount(double discount) {     
               this.discount = discount;     
           }     
           public double getPrice() {     
               return basePrice*discount;     
           }        
    }        

???????????????????????????????????У???“?仯”?????PricePolicy?????檔???????y???????????????????Part???????????????????趨??????????????????????????ConcretePart????????????????л??????????????????“?仯”?????????????????????

??????????????(LSP)

(1) ??Barbar Liskov(?????.????)????????и????????
(2) ?????:????????????T1?????o1???????????T2?????o2???????T1????????г???P?????е????o1????????o2???????P???????б仯?????????T2??????T1????????.
    ????????????????????????????????????????????????????????????????????????????????????????????.?????????????滻?????????λ????????????????????????????????????????????????????????????1????
(3) ?????????????????
(4) <ī??.С?>???:"????????; ???????????.????(????)?????;????????????."
(5) ???????????????:???????????????ε?????(????"??")??????????????????????
(6) ???????????????У?????????????У???????????????????????A??B?м?й??????????????????????????????????C?????????A??B?????????C??????.?????????????й???γ?????????????????????????????????е?????????????????;?????е??????????????????????.
(7) "??????????(Design By Constract)?????DBC"????????LISKOV??????????????.??????Bertrand Meyer??????????????????:
???DBC??????д???????漲??????????.?????????д????????????????????????????????.????????????????????????????(preconditions)?????????(postconditions)???????.???????????????У???????????????.????????÷??????????????????.??????????????????????е?????(routine)??????????????????????????????滻???????????????????????????????????????滻???????????.

    ????????????????????????????????????????????????????????????????????????????????????????????棬??????滻????????????????????б仯??

LSP???и??????????е???????????滻??????????λ?????????????????????????????????????????????????????????????μ??????
  
???棬???????????????????LSP???????LSP?????????????????????е????????????????????????????????????????????A??B??????Υ????LSP??????(???????B??A???й??)?????????????????????????????????????????????