• Home
  • About

Eclipse Tips

Feeds:
Posts
Comments

Extract supertype

June 18, 2008 by David

When I’m working on a group of classes that offer similar functionality, I’ll want to create a parent class or interface to share functionality or allow the children to be used polymorphically. Eclipse has a couple of refactoring tools that make the process of creating the parent easier. Ctrl-Alt-T to open the refactoring menu and then select Extract interface… or Extract superclass… depending on how you want your hierarchy to behave. Then, select the methods and fields that should be promoted to the parent and voila, Eclipse will create that supertype with the methods and fields you specified.

Today’s tip:

Ctrl-Alt-T, then Extract interface/superclass: moves methods and fields into a new parent supertype

Posted in refactoring | Tagged who's your daddy | No Comments Yet

  • Archives

    • June 2008
    • December 2007
    • November 2007
  • Category Cloud

    debug editor help navigation other plugins refactoring run search

Blog at WordPress.com.

Theme: Mistylook by Sadish.