Exforsys

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects

Ads


Home arrow Reviews arrow WebSphere Tutorials

WebSphere V5.0 : Java Development - Use refactoring features

Author : Exforsys Inc.     Published on: 26th Feb 2006

WebSphere V5.0 : Java Development - Use refactoring features

In this tutorial you will learn about WebSphere V5.0 : Java Development - Use refactoring features, Refactoring support, refactor actions, rename, Move, Pull Up, Modify Parameters, Extract Method, Extract Variable, Inline Local Variable and Self Encapsulate Field.

Ads

Refactoring support

The goal of refactoring (behavior-preserving program transformation) is to make a system-wide code change without affecting the behavior of the system. The JDT provides assistance for managing refactorings.

The JDT supports a number of transformations (e.g. Extract Method, Inline Local Variable) described in Martin Fowler's book "Refactoring: Improving the Design of Existing Code", Addison Wesley 1999.

When performing a refactoring operation, you can optionally preview all the impending changes resulting from a refactoring action before you choose to carry them out. Thus, you can execute a refactoring in one of two ways:

  • Refactoring with preview

In a controlled refactoring, you are notified of potential problems and are given a detailed preview of what the refactoring action will do.

  • Refactoring without preview

In a quick refactoring, the potential problem notification and preview are omitted. If a Stop problem is detected, the refactoring will be halted and a list of problems will be displayed.

Refactoring commands are available from the context menus of several Java views (e.g. Package Explorer, Outline) and editors.

Refactor context menu

Refactor actions

Refactor menu commands:

Refactor menu

Rename

Starts the Rename refactoring wizard: Renames the selected element and (if enabled) corrects all references to the elements (also in other files). Is available on methods, fields, local variables, method parameters, types, compilation units, packages, source folders, projects and on a text selection resolving to one of these element types.

Rename

Rename preview

Move

Starts the Move refactoring wizard: Moves the selected elements and (if enabled) corrects all references to the elements (also in other files). Can be applied on one or more static methods, static fields, types, compilation units, packages, source folders and projects and on a text selection resolving to one of these element types.

Pull Up

Starts the Pull Up refactoring wizard: Moves a field or method to its super class. Can be applied on one or more methods and fields from the same type or on a text selection resolving to a field or method.

Modify Parameters

Starts the Modify Parameters refactoring wizard. Changes parameter names and parameter order and updates all references to the corresponding method. Can be applied on methods with parameters or on text selection resolving to a method with parameters.

Extract Method

Starts the Extract Method refactoring wizard. Creates a new method containing the statements or expression currently selected and replaces the selection with a reference to the new method. You can use Expand Selection to from the Edit menu to get a valid selection range. This feature is useful for cleaning up lengthy, cluttered, or overly-complicated methods.

Extract Variable

Starts the Extract Variable refactoring wizard. Creates a new variable assigned to the expression currently selected and replaces the selection with a reference to the new variable. You can use Expand Selection to from the Edit menu to get a valid selection range.

Inline Local Variable

Starts the Inline Local Variable refactoring wizard. Replaces the references to the selected local variable with the variable's initializer expression and removes the variable.

Self Encapsulate Field

Starts the Self Encapsulate Field refactoring wizard. Replaces all references to a field with getting and setting methods. Is applicable to a selected field or a text selection resolving to a field.

Self Encapsulate Field

Ads

Self Encapsulate Field. Preview

Note: Refactoring commands are also available from the context menus in many views and the Java editor.

_____________
Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.



 
This tutorial is part of a WebSphere Tutorials tutorial series. Read it from the beginning and learn yourself.

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects
 

Comments