Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design by contract. According to my understanding, each contract must define and satisfy the precondition to get the desired post-condition. My question is can we
Design by contract. According to my understanding, each contract must define and satisfy the precondition to get the desired post-condition. My question is can we extend this idea of contract and use it when creating abstract classes?. For example, we define an interface which acts as a contract. Any class that wishes to implement the interface must override all the methods defined in the interface. How do we handle the cases where an implementer adds more methods? Does this violates the contract?
Please correct me if I am wrong!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started