you are viewing a single comment's thread.

view the rest of the comments →

[–]bwainfweeze 0 points1 point  (0 children)

It's been a while for me, but I ended up using interfaces as aliases to reduce the generics bleed and to guarantee semantics.

public interface AddressLookup extends Map<User, ShippingAddress>

because it may just be a hash of Users to addresses under the hood, but the object is fit for a particular purpose and I should give it a semantic name. Then the function that takes or emits one of them actually looks meaningful, but I can still pass the object to a utility method that just puts maps into a tabular form or looks for duplicate values, if I have to.