tl;dr:
Hi guys, is there a design pattern I can use that:
-
Could be equivalent to having static interfaces (which are impossible)
-
Has to be used in a language that does not support multiple inheritance (C#)
-
Is implemented by a lot of different classes for similar (but not identical) behaviour, that must be accessed statically (ie: formatting a string, which each class does a different way).
-
May have several different behaviours per class, so Class A and B both have methods x() and y(), but Class C has x() and z().
Essentially, I want to have "static interfaces" for specific static methods that can exist in specific, different classes.
Original question (more in-depth, and I explain everything in more detail): What design pattern should I use? Different classes, same static behaviour
Aucun commentaire:
Enregistrer un commentaire