I have a waypoint class which i use to connect a bunch of other waypoints up.

But i also have a special type called a consumer, this is not technically a waypoint but it needs to act like one in that waypoints need to connect to it.

So i thought about using an interface due to this has a nature of the consumer so i can have both types listed together like

Waypoint, IWaypoint
Consumer, IWaypoint 

Consumer is an object that does many things beyond just being a waypoint, but it also connects to the waypoint system to receive agents, so i feel like this means consumer has a waypoint relationship.

But to me it seems a bit code smell for Waypoint to have the interface IWaypoint since it feels a bit redundant.

Is this the right way to do it ?

  • My immediate thought here is that "Consumer is an object that does many things..." already suggests the SRP has been broken and this interface will just make things worse. But, as @kevin-cline says, you aren't really providing enough info for us to offer you much in the way of useful advice.
    – David Arno
    May 14, 2018 at 9:09
  • Interfaces are only for multiple inheritance, to work around the limitations of the language, C# or Java. Don't create one unless you have multiple classes inheriting from the interface. May 14, 2018 at 15:20
  • @FrankHileman Are interfaces not so that classes adhere to a contract so that a specific implementation may be used in place of another? Your comment seems to suggest otherwise, as I interpret it at least.
    – Shelby115
    May 14, 2018 at 17:19
  • @Shelby115 Interfaces are a specific type of class that allows multiple inheritance. That is using the word "interface" in the meaning given by specific languages, C# and Java. Interface can also mean exactly what you describe, a contract, and the use of the same word for both has caused enormous confusion, just as the use of the word "abstract" as a keyword now causes people to confuse the true meaning of the word with a language specific definition (in C#, "abstract" means incomplete or unimplemented). May 14, 2018 at 17:24
  • @FrankHileman Multiple Inheritance implies that the class implementing an interface would be inheriting implementations from multiple classes. Which, at least in C#, this is not how interfaces work at all. Interfaces are contracts in C# where multiple classes can implement one or many interfaces. They are not inheriting anything and therefore it is not multiple inheritance. Now for Java, I cannot state whether this is true or not.
    – Shelby115
    May 14, 2018 at 17:27

1 Answer 1


There's no way to make design choices without specific use cases to support. So pick one specific use case and implement that in any way possible. Then implement the next use case and refactor as necessary to eliminate duplicated code.

Or expand your question with some specific requirements and maybe you can get some good ideas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.