In this part of my code refactoring tutorial, we’ll look at how to replace a primitive type with a class.
Type safety is very important! So, what we want to do is to eliminate all operations on values that are not of the appropriate data type by protecting the program from bad input. One way we can do this is by replacing primitive types with classes. I’ll walk you step-by-step through the process. The code below will help you along.
If you like videos like this, it helps to tell Google+ [googleplusone]
Code From the Video
ATMAccessBad.java
ATMAccess.java
Hi,
Do you happen to have an aspect oriented programming video tutorial?
I haven’t covered that specific topic yet. Much of the beliefs are incorporated into many of my OOD tutorials, but the specific topic is not
It would be great if you made that specific thing.
I quite accustomed to your easy to understand lessons in OOP design 🙂
Thanks, anyway
Thank you 🙂 I’ll see how I can fit it in. I’m always juggling how to fit topics into my current plans
Hey Derek,
Why not use Enums instead of creating a class as internally an enum is converted to a class and values in enum to objects?
You could definitely do that. I was following a plan of refactoring this time in a different way.
Ok, thanks for clarifying