SOLID Design Principles: Interface Segregation Design Principle

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • INTERFACE SEGREGATION PRINCIPLE (ISP)
    ---
    The Interface Segregation Principle (ISP) states that a class should not be forced
    to implement methods it doesn’t need.
    In other words, a class should have small, focused interfaces
    rather than large, monolithic ones.
    Interface Device
    - printDocument
    - scanDocument
    - faxDocument
    Printer implemented Device (BAD DESIGN)
    - printDocument
    - scanDocument
    - faxDocument

ความคิดเห็น •