Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refactoring code??

 
Isha Mackker
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In the section 6 of the exam objective for SCJP 5.0, one objective is:
"Recognize the limitations of the non-generic Collections API and how to refactor code to use the generic versions."
Can anybody help me out in what does the term "refactor" means and how code can be refactored?
Thanks and Regards,
Isha.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent Links Steve. I like the link at WikiPedia that describes refactoring as "cleaning it up" see

http://en.wikipedia.org/wiki/Refactoring

Here is how I comment on that topic in my new book on the JDK 1.5 exam

What does refactor mean? Refactor means to modify and improve existing code, but in such a way that it still includes its original functionality. Improving code implies that it is easier to understand and use. Refactoring is a big subject and modern development tools such as NetBeans and Eclipse include menu options entitled refactor. However refactoring generally means the programmer understands the issues behind the code that is being changed. Refactoring brings with it the obvious benefits of better code, but the danger of the introduction of new bugs. To be able to answer the questions that emphasise refactoring means you need to understand both the old versions of the Collections classes and the new Generic parameter versions.

Before GenericsGenerics are designed mainly for use with Collections, i.e. Classes that act as containers for instances of other classes. You need to be familiar with using and creating container classes for this section to make much sense. The standard Java Collections hold all elements as Object references. Because all classes are of type Object this means there is no checking for homogeneity (being of the same type).

etc etc

From
http://www.examulator.com/tamer
[ November 17, 2005: Message edited by: Marcus Green ]
 
Isha Mackker
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for the useful links.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic