Yes, I know all classes have atleast a default constructor. That being
said though -- I like the concept of a clearer line with this issue:
If it's a publically exposed method then do it -- The Syntax of
repeated generics is counter productive -- you could easily loose
track of what's going on -- especially when you have something like
List<Map<String,Map<String,Object>>>
filterList(List<Map<String,Map<String,Object>>>
listA,List<Map<String,Map<String,Object>>> listB)
encapsulating that Generic monster would greatly simplify the syntax
and specifically express what you're doing.
> [top-posted]
Please do not top-post.
> Yes, I know all classes have atleast a default constructor. That being
> said though -- I like the concept of a clearer line with this issue:
> If it's a publically exposed method then do it -- The Syntax of
> repeated generics is counter productive -- you could easily loose
> track of what's going on -- especially when you have something like
> List<Map<String,Map<String,Object>>>
This would be a lot clearer if you'd drop a little white space into it, but
then, that would diminish the point you're trying to make wouldn't it?
Intellectual honesty would seem to mandate that you make the arcane idiom as
readable as possible, not as obtuse as possible, before deciding if it's
readable enough or not.
> filterList(List<Map<String,Map<String,Object>>>
> listA,List<Map<String,Map<String,Object>>> listB)
>
> encapsulating that Generic monster would greatly simplify the syntax
Yes
> and specifically express what you're doing.
No - it would specifically *hide* what you're doing.
This was discussed at great length recently in a thread about a proposed
"typedef" feature.
I myself am of the opinion that the generic decorations are useful, and that
the few places where a "typedef" would help are for the most part covered by
the subclassing idiom. It seems that I am in the minority in that opinion.
It is difficult for me to imagine where a List < Map <String, Map <String,
Object >>> would truly be useful, and if you did have something that rococo, I
for one would like it explicitly documented every time, specifically so that I
would *not* lose sight of how ugly and overblown the data structure is.
Can you give a use case where that structure would actually be helpful, in
lieu of refactoring it to something more reasonable?

Signature
Lew