Recently I’ve written some code to retrieve only one flag from opportunity entity at JS. Beside that JS entity had registered plugin at PreRetrieve.
Of course in plugin code I was checking if DEPTH > 1 and do nothing then. While debugging plugin execution I was so frustrated because plugin was fired at accidental moments.
It occurred that SAOP retrieve query also fires plugin execution.
- uses LogicalName
- synchronous operations
- invokes plugin and workflow with depth = 1
- big XML structure
- use DataSets and SchemaName
- synchronous and asynchronous operations
- no interaction with plugin or workflow
Private conclusion: If you want quick, also asynchronous operations, and no interaction with plugins or workflows is needed use REST operations.