What is the best way to program against an anticipated type change. Say, I may have to use Joda DateTime instead of Java Date in the future. Since Java doesn’t encourage anti pattern like typedef, what is the best way to ensure an easy refactoring in the future.
thanks.
What is the best way to program against an anticipated type change. Say, I
Share
Certainly the “Single Responsibility Principle” or something near it and encapsulation should help limit dependency creep.
However, choice of basic types is an architectural decision. If you were to change string or integer types, you’d expect change across your code. Date isn’t that much different.