enum strategies
whenever a new, major java version is available, developers seem to feel that they must use all the new language features (unless they don't mind being categorized as retro coders). sooner or later, the code base is thus full of generified APIs, StringBuffers are replaced by StringBuilders, and enumerations seem to be the solution for any kind of problem.
in fact, enums do come in handy in a lot of cases (and it was about time to introduce them to the java world). while the killer example enum Suit { CLUBS, DIAMONDS, HEARTS, SPADES } might only be of limited use in our daily life, it is the strategy pattern-nature of enums which seems to invade our source tree quite successfully.
the general usage is commonly something along these lines:

while i don't really have a problem with code like this as long as the item implementations stay as simple as in this example, the "pattern" gets kind of smelly, the more complicated the enum gets (more than one abstract method, concrete base implementations mixed with invocations of multiple abstract methods; too much logic in the concrete method bodies, etc.).
as already mentioned: i'm kind of torn between thinking of this as a clever and simple solution, and between categorizing it as a smelly abuse of language functionality about which i'll roll my eyes in a couple of weeks already. in that sense, my current state is about comparable to any pattern-newbie's love for singletons.
i'm looking forward to comments from more experienced (and/or opinionated) people.













