I am wondering what is the best practise for doing the following;
I am going to query an api, and it will return xml similiar to this.
I'll then use this to build an arraylist of objects. Should I;
1) Create a class with all the above fields in the 1 class of type Event, or
2) Create an Event base class with id as it's only field then 3 more classes like 'EventTypeC' that extends Event and then add the C_Specific value in this constructor?
If it's number 2, what would be the best way of taking this information then building an ArrayList<With_Multiple_Object_Types>?
Thanks in advance for the feedback. I'm assuming people will say it's a personal choice but I guess I'm looking for what is the best approach. I'm learning so would like to learn the right way, but i'm weighing up the extra effort of deciding what object i'm dealing with etc when i decide to scan the arraylist and deal with each event independantly and perform actions based on the event type.