codedamn

S.O.L.I.D Principles

Created by Piyush Garg about a year ago

0

No description provided

1 Comment

    0

    Hello Piyush,

    In S.O.L.I.D you said, for "I" create an interface and then implement it in class. Now we are calling Pet() method again and is not same thing as calling the same method from class. example:

    class Dog extends Animal implements Petable{ public void Pet(){...}};

    class Cat extends Animal implements Petable{ public void Pet(){...}};

    class Horse extends Animal implements Petable{ public void Pet(){...}};

    We are calling Pet() in both Dog, Cat and Horse. Is this not violation of D.R.Y ?

    Could you please help me understand this concept because this is getting very confusing for me.

    Thank you, Hitesh Shridhar.

    @hitesh63b6e1f1

    Hitesh Shridhar

    @hitesh63b6e1f1

Your comment