Empty superclass?

I want to have an observable list that TableObjects (Self made class) can display. I will send this observable list to a TableView object. My question is, does it make sense to have an empty superclass?

I'm going to create three different tables that show three different types of objects. My plan is to create these types from TableObjects, which means I will create subclasses that extend TableObject. So TableObjectA, B and C will all have String values ​​like name or type.

Actually I could just remove the superclass of the TableObject class, but isn't that in my best interest for specific design reasons? I didn’t know much about software development and how to develop software that will develop friendly in the future from the courses I have taken.


source to share

2 answers

You are just describing the marker interface template , and in your case it should not be an empty superclass but an interface.



If your superclass is normal behavior, you can have it in place. If you want all of your classes to include some specific behavior, you can have an interface. But, if you only want to have a superclass to combine multiple child classes together or for whatever reason, I would recommend sticking to the appropriate class naming convention to do this, and NOT having a superclass.



All Articles