QuestionQ14

Design and implement optimal solutions for Adobe Commerce to meet business needs

An Adobe Commerce Architect must log the result of a ServiceClass::getData method execution after every plugin has run. The method is public, and several plugins are declared for it. These include after and around types, all with a specified sortOrder.

Which solution should be used to fulfill this requirement?

  • A Declare a new plugin with the sortOrder value lower than the lowest declared plugin sortOrder and implement aroundGetData method.
  • B Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement afterGetData method.
  • C Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement aroundGetData method.
Explanation

A lowest-sortOrder around plugin is the outermost wrapper in the interception chain. Logging the returned result after calling its proceed callable occurs only after the observed method and all higher-priority plugin execution—including after methods and the post-call portions of around plugins—have completed.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!