@Deprecated
- Used in managed packages
- Any classes,methods, interfaces, exceptions,variables or enums ,etc which can no longer be referenced in subsequent releases (of that Managed Package).
- Mostly used when you are refactoring / making more changes/improvements in your Managed Package as the requirements evolve.
- It restricts new subscribers to see "deprecated" elements while existing subscribers/API integrations get proper functioning elements as they were.
- All 'global' modifiers need to be 'deprecated' as who referred your 'decprecated' element.
- Unmanaged packages cannot contain code that uses the deprecated keyword.
- Can't use with WebSerivces
- Enum, Interface, Abstract classes need to depcrecated totally - cant decpracate individual method or individual enum value.
EXAMPLE :
// This method is deprecated. Use myOptimizedMethod(String a, String b) instead.
@deprecated
global void myMethod(String a) {
}
1)Supports data in the form of XML only 2)Requires WSDL for the integration 3)Use SOAP API in any language that supports Web services.
REST API
1)Supports both XML and JSON format 2)Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster