heres my question:
which tend to change more frequently: interfaces or implementations? How does proper OO design take advantage of this observation?


I think the answer is implementations

Recommended Answers

All 4 Replies

I would probably agree with that, but why do you think that implementations change more often than interfaces?

When properly designed, Implementations would change more often than Interfaces.

implementations implement the interface members. interface doesn't really do much other than have some items, which you can't change in the code. while implementation can change data of the items in it.

is this about right or atleast close?

You are on the right track, but try to think of interface in this question as WHAT something does, while implementations are HOW something does it. What are the repercussions of changing WHAT something does as opposed to HOW it does it?

Imagine you write an application that uses code that I have written. What happens to your application if I change HOW my code does something? What happens to your application if I change WHAT my code can do?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.