A way to enforce static properties in sub-classes

This is usually what I do.
If you also wanted to do constructor-like instance creation from that object,

val myGit = Git()

you could add an abstract invoke method to the VCS class (although you may have to do something like recursive generics if you wanted that constructor to return a more specific type than VCS)

1 Like