*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Refactoring code?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Refactoring code??" Watch "Refactoring code??" New topic
Author

Refactoring code??

Isha Mackker
Greenhorn

Joined: Oct 18, 2005
Posts: 29
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

Joined: May 22, 2003
Posts: 657

Refactoring
Refactoring: The key to unraveling spaghetti code
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
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 ]

SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Isha Mackker
Greenhorn

Joined: Oct 18, 2005
Posts: 29
Thank you both for the useful links.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Refactoring code??
 
Similar Threads
need resources for objective 6.3
Meaning of "how to refactor code to use the generic versions"
XP and SCJEA ?
Need help for SCJP 5.0
Is the Stack collection class on the exam?