>Hope all the questions are answered!!
Thanks for answers! But unfortunately I haven't understood a few things...
>Here the Design seems to be not correct. I don't see any difference between Base class Derived classes. So need to revist Design here.
I see difference. It is weight, that scales can carry out.
KitchenScales: max. weight 100 pounds
IndustrialScales: max. weight 100000000 pounds
And these two classes have the same interface, so either of them can be used through ABC.
For example, you have two classes:
And they both have similar function: heart_beat()
Why not connect them through ABC "Breather" with abstract function heart_beat()?
I think my example with Scales are the same...
>We cannot define Pre and Post conditions for ABC!!
I meant defining Pre-Post conditions not for ABC, but for its functions.
...In order for the LSP to hold, and with it the Open-Closed principle, all derivatives
must conform to the behavior that clients expect of the base classes that they use.
Clients would use classes KitchenScales and IndustrialScales not directly, but through ABC Scales.
And If this ABC doesn't have any behavior, just function's signature, then about what behavior, that clients will be expect, we are talking about? So, I think abstract base functions must have pre|post conditions.
Please, correct me, if I am wrong.