In last two posts I showed you what enums in java can give us and what we can do with them. I hope that right now you will agree with me that enums are really powerful.
Today I want to present you a few things which you can treat as a warning sign whenever you will see something like this in your own code.
But you need to remember that it's just a sign, nothing more. It doesn't mean that you shouldn't solve your problems in presented ways, it would be enough to take a deep breath, look at code once again and then made decision if it should be changed or not.
On the end of my last post I asked a couple of questions about examples given by me. If there was something worrying in them? Were they good or not?
Today I will try to explain why I asked those questions and I will share with you my thoughts about problems that can occur when we are overusing enumerations.
Let's start :)
Showing posts with label enum. Show all posts
Showing posts with label enum. Show all posts
Monday, March 10, 2014
Friday, March 7, 2014
This powerful Enum - part 2
let's move on
Recently I wrote about basics of Enums and when we finally knows them, we can take the next step and look how powerful Enums in Java really are.Today there will be more code, mostly covered with tests to prove that it works as I wrote :)
Tuesday, February 25, 2014
This powerful Enum - part 1
a few words at the beginning
Today we will take a look at Enums in Java. Let's start with a definition:
Enumeration - a collection of items that is a complete, ordered listing of all of the items in that collection.
Sounds simple isn't it? Even if, Enums in Java allows us for many things and it's a really great language's feature, which can increase quality of our code.
Subscribe to:
Posts (Atom)