Your problem has nothing to do with java colletcions framework. ALso I do
not think java collections framework is 高深. But that is off the topic.
Java is a strong type and object oriented language. you should be able to
find tons of articles and books talking about why an object oriented
language is better than procedural languages for enterprise applications.
Using map to save the heterogeneous class states not only defeats the
purpose of the strong type language, but also fails to mimic the domain
world and thus reduce the chance of class reuse. Also there are other issues
, such as casting, inheritance, and coupling.
I am not saying that you should never do it. In one case, I have used a
class like this as the context bag to pass up objects to a depended modules.
So inside the depending modules, I can write all different handlers to
process those objects at the right moment when the whole process is still in
the upstream module. The only reason that I did that was to create
unidirectional dependency from down stream modules to upstream modules. But
it was a very complicated system. For a novice, I really doubt that you will
need to do it.