DEV Community

loading...

Discussion on: Pseudo Traits in C#

Collapse
bandysc profile image
Bartosz Korczyński

What is the point of having Trait class here instead of traits being just an empty interface? Just to know it is a "pseudo trait"?

Collapse
htissink profile image
Henrick Tissink Author

It's a filter/grouping, so you know that what you're extending is definitely a (pseudo) trait. You can do without it - it's definitely a stylistic choice. But I like the safety of it. Your CanRoll or CanBounce fall in the same category of trait classes.