Should I extend ArrayList to add attributes that isn't null?
I would like to add a collection of objects to an arrayList ,only if the particular attribute is not null. I am thinking of extending the ArrayList and implementing the check inside the child class. One alternate way is to check for the the attribute before putting it in a Arraylist, but that would mean , i will have to scatter the if checks every where if i need to add the objects to the arraylist based on the logic. I would like to know your thoughts on it ... on a second thought is it a overkill ? Tomasz Nurkiewicz Decorator pattern I would actually recommend wrapping ArrayList using well