Array, List, Buffer, Hashmap... How to use, what to choose?

hello everyone, I’m trying to make something like a Forum. But, there is no database, so, for the begining, I though about 2 solutions :

  1. Post {id, title, message, [answer]}
  2. Post {id, id_ref, title, message}

I though the first model seems more easy. But I don’t know if it can be problematic in terms of resources. Also, I don’t know why but I can’t modify and add value in the array inside the array…

More of that, I don’t know what kind of data structure I should use to store all messages… buffer seems good but you have to initiate the capacity… it seems obscure to me, how to manage that for messages that can grow infinitely?

I’m really stuck with these questions and I can’t move forward unless someone gives me a good direction. I hope you can help me.

Now, i think that I should store all post in a Hashmap, associated with an ID (Key). Am I right ?

1 Like