Best Design Approach

So im making an API for a marketplace and i have different kinds of listings (footwear, clothes and accessories) where the enum attributes "subcategory" and "size" would change based on what kind of listing it is, what would be the best design approach for creating these listings? inheritance? factory? Thanks
3 Replies
JavaBot
JavaBot3mo ago
This post has been reserved for your question.
Hey @Victor! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Victor
VictorOP3mo ago
I ended up using a method factory to create the different types of listings and used an interface for the "size" and "subcategory" attributes and using different enums for each situation implementing the interface, if anyone has a better idea or any tips please let me know
JavaBot
JavaBot3mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?