Once a global class method or member has been effectively published by including it in a released package, it cannot be removed or changed (this was discussed in Chapter 1, Building and Publishing Your Application, as part of the discussion on managing package ancestry). If you were to create a scratch org configured with your package ancestry, as described in Chapter 1, Building and Publishing Your Application, if you tried changing the ComplianceService.verify method by renaming it verification (for example), when you attempt to push the class to such a scratch org, you will receive the following error:
(ComplianceService) Global/WebService identifiers cannot be removed from managed application: Method: void verify(SET<Id>) (Line: 1)
The @Depreciated annotation can be used to effectively remove the visibility of the class, interface, method, or member that global has been applied to from the perspective of subsequent package version consumers. Developer X can still access the deprecated items by referencing an earlier version of the package through the class version settings shown via the Version Settings tab as described in more detail in the following sections.