This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have got a question about deprecated methods. Do they cause any performance issue when used in your application? What are the drawback of using a deprecated method. Does it affect the functioning and performance in any way?
"Weekends don't count unless you spend them doing something completely pointless."
There are a number of reasons why a method or class may become deprecated. An API may not be easily extensible without breaking backwards compatibility, and thus be superseded by a more powerful API (e.g., java.util.Date has been deprecated in favor of Calendar, or the Java 1.0 event model). It may also simply not work or produce incorrect results under certain circumstances (e.g., some of the java.io stream classes do not work properly with some encodings). Sometimes an API is just ill-conceived (SingleThreadModel in the servlet API), and gets replaced by nothing. And some of the early calls have been replaced by "Java Bean"-compatible methods (size by getSize, bounds by getBounds etc.)
So there are a number of reasons why an API can be deprecated. Study the javadocs for the classes and methods you use to see whether it is advisable to avoid them in your case. I don't generally advise to remove deprecated methods just for its own sake, but to consider the circumstances.
It is a matter of decision and risk, deprecated means that you should not be using those methods as part of a new development. Basically because they are known to have undesirable behavior (lets say lack of precision, lack of portability, problems with performance). They are kept because some times it is mandatory to have backward compatibility in software maintenance. Normally when something is deprecated it is replaced by a better option, so if you can choose go for the non deprecated functionality. Just for your own security and good practices.
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.