For example, let's assume that the following data structures all implement the mapping of Lemmas->PartsOfSpeech->ListOfWords (topic choice is arbitrary and has nothing to do with question):
Map<ArrayList<Lemma>, Map<PartOfSpeech, ArrayList<Word>>> mainMap = new HashMap<>();
Map<ArrayList<Lemma>, PartOfSpeechWordMap> mainMap = new HashMap<>();
LemmaMap mainMap = new LemmaMap();
Where PartOfSpeechWordMap
contains and manipulates Map<PartOfSpeech, ArrayList<Word>>
, and LemmaMap
contains and manipulates one of the above structures.
The list goes from most transparent and complicated, to least transparent and simplest; however, I'm not sure which is best from an object oriented perspective. As you go down the list, it gets more and more difficult to figure out what's going on, despite being more concise and having simpler syntax.
I understand that this question may be a little subjective, but I'd like to know if there are standard industry practices when dealing with something like this.
EDIT:
I wasn't thinking and didn't consider the issue with mutable keys. Let's assume that I'm using ImmutableList
per Guava. Nonetheless, the point of my question was which structure makes most sense from an OOP perspective with regards to the varying levels of transparency.