exam questions

Exam AD0-E718 All Questions

View all questions & answers for the AD0-E718 exam

Exam AD0-E718 topic 1 question 2 discussion

Actual exam question from Adobe's AD0-E718
Question #: 2
Topic #: 1
[All AD0-E718 Questions]

An Adobe Commerce Architect needs to log the result of a ServiceClass::getData method execution after all plugins have executed. The method is public, and there are a few plugins declared for this method. Among those plugins are after and around types, and all have sortOrder specified.
Which solution should be used to meet this requirement?

  • A. Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement afterGetData method.
  • B. Declare a new plugin with the sortOrder value lower than the lowest declared plugin sortOrder and implement aroundGetData method.
  • C. Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement aroundGetData method.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
1 year, 4 months ago
Correct answer is B. Around method will start executing as the first, then will execute all the other existing plugins and after that will execute the part after proceed().
upvoted 1 times
...
abhilash198
1 year, 7 months ago
B should be the answer : After part of lowest sort order around method will be executed in the end
upvoted 2 times
...
Alexstep77
1 year, 7 months ago
Selected Answer: B
Good explanation in the docs see scenario C https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago