It depends if listener has to be used by multiple object than making it a full fleged class make sense but if its only attached to one element than having them as inner class is ok.