I am trying to make an Android application where you can buy and sell items. I've run into a wall: I am stuck at how to represent categories and sub-categories. Any category can have some number of sub-categories, and these sub-categories can also have sub categories with fields in them, etc.
For instance, let's say you want to sell a pair of your watches, the category and sub categories might be:
-Jewelry
--Men
---Watches
----Rolex
or it might even be
-Jewelry
--Men
---Watches
----Rolex
-----Models
------SubMarine
How would you represent this with a class hierarchy? I can't seem to find a solution that doesn't end out with a ton of classes and something that is difficult to update.
I was thinking of using Jackson/Gson, Mysql/MSSQL for storage and most likely rest services for saving it; bonus points for an answer that can integrate with those technologies.