JADE Environment Development Ideas

What's new in the upcoming JADE release?

IMPROVED DEVELOPER EFFICIENCY. ENHANCED SECURITY. SMOOTHER INTEGRATION

The JADE 2022 release meets tomorrow’s business demands.


Start your update to JADE's latest release

Extract Method default to creating protected methods

We have had issues in the past with unnecessary creation of public methods, so we find it better if developers are defaulted to creating protected methods and must explicitly change it to public only when needed.

 

We use the Options>Preferences>Schema>Methods Access set to Protected and that works great for new methods.

 

However when using Right Click > Refactor > Extract Method command currently all methods are created as public.

 

Could the default for methods created with Refactor be set to protected as I imagine most use cases will be extracting to protected methods. Or if that isn't true at least make it configurable like it is for new methods in the preferences?

 

 

 

  • Roger Lammers
  • Jan 9 2020
  • Shipped (2020)
  • Attach files
  • Roger Lammers commented
    January 13, 2020 03:55

    Good suggestion on inheriting, but for our use case I'm often extracting protected methods from public ones, so that wouldn't help in those scenarios.

    I think the ideal compromise is for the option to be configurable in the preferences. That way we can set it to always create protected methods and existing developers who prefer creating public methods are unaffected by the change.

  • Ty Baen-Price commented
    January 13, 2020 00:45

    Inheriting sounds eminently sensible.

  • BeeJay commented
    January 13, 2020 00:14

    Maybe it would be better to 'inherit' the setting of the originating method?

  • John Porter commented
    January 12, 2020 22:25

    I would prefer it created Public methods. Perhaps it should follow the option set in Preferences?