Process to remove global classes in managed packages - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
370  Points
Open
Idea has been posted. Give it an upvote or downvote.

Process to remove global classes in managed packages

Development (Apex, LWC & VF)

Global Apex classes and methods are really troublesome in managed packages. Once you create the class or method and include it in a managed package you are stuck with it. This is really troublesome when developing a managed package in an agile way.

The platform needs to be updated to introduce a mechanism that doesn't require any intervention by Salesforce and that can be applied by the ISV who created the managed package.

My suggestion is as follows:
  1. Allow the vendor to mark a class or method as deprecated, setting a termination threshold - this threshold could be "at version X" or "after date Y". There would be specific constraints applied to these values by Salesforce (e.g. for version-based it may require a major version change, whilst for date-based it may require the date to be at least 6 months away, for example)
  2. Permit deprecated classes/methods to be modified during this period (e.g. for bug fixes)
  3. Once the period has elapsed (or the version has been reached) the class or method can be deleted from the managed package (or can be changed from global to public, for example).
The current mechanism is, to me, an anti-pattern as it does not allow the software to cleanly evolve with changing requirements and customer needs. Clearly, it has the benefit that a customer's usage of a global from a managed package will continue to "compile", but this doesn't mean that the customer's usage will actually function as expected (it is common to work around this limitation by basically retaining the global but emptying its body so it becomes a "no op").

By introducing this process, managed package developers are more likely to maintain out-of-date code in the short-term (e.g. with bug fixes) knowing that there is an horizon after which it can be cleanly expunged from the managed package. Additionally, the customer could automatically receive a report of newly deprecated or removed globals each time they install a version of the managed package so they can plan accordingly.

Merge Idea · Flag

  • Upvotes
  • Downvotes

Ideas

Apps

from AppExchange

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



 

 

Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


 

Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.