I am relatively new to Java - especially when it comes to interfaces and abstract classes (I do know how to use them), however in this case i am a bit confused how i should setup my architecture. First of all, i'd like to say that this is just a project for fun - but ofcourse the main goal is to get experience :-).
Let's get down to business!
I had the wonderful idea of creating a website where you can buy and sell items. I am thinking of using Json, jax-rs and some kind of database(might end with NoSQL/MsSQL.
However, i seem to have a problem of creating the architecture, and how it should be done properly.
All ads have some things in common (They should all contain pictures, ad text, price, etc).. Thats not the problem. The problem is i don't know how to handle all of the differences that some ads might have... Such as an ad under the category "Electronics" might have a lot of different fields than another ad under the category "Clothes"..
I mean.. it could look like this:
Clothes -> Men -> Sweaters
Electronics -> Phones -> Apple
Electronics -> Televisions -> Samsung
How the hell would YOU handle that?
Imagine the two following ads:
AD1: Text: I want to sell my television Price: 100USD TimeCreated: Today(Datetime, whatever) Category: Electronics SubCategory: Televisions ScreenSize: 40" Brand: Samsung Model: 700UHD
AD2: Text: I want to sell my pants Price: 10USD TimeCreated: Today(Datetime, whatever) Category: Clothes SubCategory: Men pants? Brand: Diesel Size: 32 Length: 40¨ Condition: Bad
I really hope you get the idea - im really confused as to how i should handle this issue.
Thanks for your time.