Answer by Felipe Tuyama for What does "program to interfaces, not...
"Program to interfaces, not implementations" is a design principle associated with the Gang of Four, a group of authors who wrote 'Design Patterns: Elements of Reusable Object-Oriented Software'The...
View ArticleAnswer by Raghav Navada for What does "program to interfaces, not...
If you were to write a Car Class in Combustion-Car era, then there is a great chance you would implement oilChange() as a part of this Class. But, when electric cars are introduced, you would be in...
View ArticleAnswer by Mathieson for What does "program to interfaces, not...
As others have said, it means that your calling code should only know about an abstract parent, NOT the actual implementing class that will do the work.What helps to understand this is the WHY you...
View ArticleAnswer by rektide for What does "program to interfaces, not implementations"...
interfaces describe capabilities. when writing imperative code, talk about the capabilities you are using, rather than specific types or classes.
View ArticleAnswer by Vincent Ramdhanie for What does "program to interfaces, not...
Think of an interface as a contract between an object and its clients. That is the interface specifies the things that an object can do, and the signatures for accessing those things.Implementations...
View ArticleAnswer by Gabriel Ščerbák for What does "program to interfaces, not...
This statement is about coupling. One potential reason for using object oriented programming is reuse. So for example you can split your algorithm among two collaborating objects A and B. This might be...
View ArticleAnswer by this. __curious_geek for What does "program to interfaces, not...
Interfaces are just contracts or signatures and they don't know anything about implementations.Coding against interface means, the client code always holds an Interface object which is supplied by a...
View ArticleAnswer by Oded for What does "program to interfaces, not implementations" mean?
It means that you should try to write your code so it uses an abstraction (abstract class or interface) instead of the implementation directly.Normally the implementation is injected into your code...
View ArticleWhat does "program to interfaces, not implementations" mean?
One stumbles upon this phrase when reading about design patterns.But I don't understand it, could someone explain this for me?
View Article
More Pages to Explore .....