[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Collapse]Refactoring Assistance
   Boolean To Enum
   Combine/Split Conditional(s)
   Compress to/Expand Null Coalescing Operation
   Compress to/Expand Ternary Expression
   Compress/Expand Assignment
   Conditional to Switch/Switch to Conditional
   Convert Nested Element to Attribute/Attribute to Nested Element
   Convert to Auto-implemented Property
   Convert to Constant
   Convert to Math.Pow call
   Convert to Property with Backing Field
   Convert to String Interpolation
   Convert to System Type/Built-in Type
   Convert to Tuple
   Convert to/Decompose Initializer
   Decompose Parameter
   Discard Variable
   Extract Interface
   Extract String to Resource
   Flatten Conditional
   ForEach to For/For to ForEach
   ForEach To Linq
   Inline Lambda
   Inline Method
   Inline Method (and delete)
   Inline Temp
   Introduce Using Statement
   Make Implicit/Explicit
   Make Read Only
   Move Declaration Near Reference
   Move Initialization To Declaration
   Move Type to File
   Move Type to Namespace
   Name Anonymous Type
   Optimize Namespace References
   Pull Member Up
   Remove Discard Variable
   Remove Variable
   Remove Variable with its Initializer
   Remove Redundant Assignment
   Remove Redundant Constructor
   Remove Redundant Delegate Creation
   Remove Redundant Destructor
   Remove Type Qualifier
   Remove Unused Member
   Remove Unused Parameter
   Remove Unused Type
   Rename
   Rename File to Match Type
   Rename Namespace To Match Folder Structure
   Rename Type To Match File
   Reorder Parameters
   Reverse Boolean
   Reverse Conditional
   Simplify Expression
   Split Initialization From Declaration
   Split String
   Use Environment.NewLine
   Use Expression Body
   Use nameof
   Use string.Compare
   Use string.Format
   Use string.IsNullOrEmpty
   Use String Builder
   Widen Scope
   Widen Scope (promote to field)
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Decompose Parameter

Expanded Purpose

This Refactoring is used to improve encapsulation. It changes the method signature, allowing you to pass only the part or parts of the object instead of the object itself. This Refactoring often helps in promoting reuse by reducing the complexity of the objects required to call a method.

Note

  • Decompose Parameter is a cascading Refactoring. That means that the Refactoring affects all method calls and method declarations in interfaces, base and descendant classes.
  • Decompose Parameter is a cross-language Refactoring. This means that this Refactoring can make required changes in projects in any supported language (see the code snippet below).

Expanded Availability

Available when the caret is on a method parameter or argument, assuming it is a class, interface or structure.

Expanded Usage

  1. Place the caret on an appropriate item in a method parameters or arguments list.

    Note

    The blinking cursor shows the caret's position at which the Refactoring is available.

  2. Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
  3. Select Decompose Parameter from the menu.

After execution, the Refactoring detects which fields and properties were used by the method and changes the method signature so that it accepts only the required fields. Then it changes the method calls according to the new signature.

Expanded See Also

Is this topic helpful?​​​​​​​