Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E716 Exam - Topic 12 Question 54 Discussion

Actual exam question for Adobe's AD0-E716 exam
Question #: 54
Topic #: 12
[All AD0-E716 Questions]

An Adobe Commerce developer has installed a module from a third-party vendor. This module fires a custom event named third_party_event_after and also defines an observer named third_party_event_after_observer that listens to that event. The developer wants to listen to this custom event in their own module but wants to execute their observer's logic after the third_party_event_after_observer observer has finished executing.

What would the developer do to ensure their observer runs after the observer defined by the third-party module?

Show Suggested Answer Hide Answer
Suggested Answer: B

To ensure that the developer's observer runs after the observer defined by the third-party module, they need to set the sort order of the new observer to be less than that of the third-party vendor's observer.

The sort order is a number that is assigned to each observer. The lower the number, the earlier the observer will be executed.

For example, if the third-party vendor's observer has a sort order of 10, the developer's observer would need to have a sort order of 9 or lower.


Contribute your Thoughts:

0/2000 characters
Walton
2 days ago
Wait, is it really possible to control the order like that?
upvoted 0 times
...
Lynelle
7 days ago
A sounds like a good idea too, but B is more straightforward.
upvoted 0 times
...
Lillian
12 days ago
I think C is a bit misleading. You can control the order with sort.
upvoted 0 times
...
Kenneth
17 days ago
B is the way to go! Just set the sort order lower.
upvoted 0 times
...
Pamella
23 days ago
I'm with Marvel on this one. B) is the way to make sure your observer runs after the third-party one. Gotta love those sort order tricks!
upvoted 0 times
...
Gene
28 days ago
Haha, C) is like saying "I don't know how to use the observer pattern, so it's not possible." Nice try, but B) is clearly the way to go.
upvoted 0 times
...
Shenika
2 months ago
C) is just plain wrong. The order of observer execution can definitely be controlled using the sort order.
upvoted 0 times
...
Alva
2 months ago
I agree with B. It's the only way to guarantee the order of execution for observers listening to the same event.
upvoted 0 times
...
Marvel
2 months ago
B) is the correct answer. Setting the sort order of the new observer to be less than that of the third-party vendor's observer will ensure that the developer's observer runs after the third-party observer.
upvoted 0 times
...
Catrice
2 months ago
I thought observers could be executed in any order, but maybe there's a way to set priorities that I'm missing.
upvoted 0 times
...
Katlyn
2 months ago
I recall a similar question where we had to manage observer priorities, and it seems like option B aligns with that concept.
upvoted 0 times
...
Annmarie
2 months ago
I'm not entirely sure, but I feel like the sequence node is more about module dependencies rather than observer execution order.
upvoted 0 times
...
Elvera
3 months ago
I think I remember that the sort order can control the execution sequence of observers, so option B might be the right choice.
upvoted 0 times
...
Annice
3 months ago
Okay, I think I've got it. B is the right answer. By setting the sort order of our observer to be less than the third-party one, we can ensure our logic runs after theirs. Nice, I feel confident about this now.
upvoted 0 times
...
James
3 months ago
I'm not too sure about this one. The question says it's not possible to control the order of observers listening to the same event, so I'm a bit hesitant to go with B. Maybe there's some other trick I'm missing here.
upvoted 0 times
...
Elza
3 months ago
Ah, I see what's going on here. The key is that we want our observer to run after the third-party one, so B is definitely the way to go. Setting the sort order is the best way to control the execution order of the observers.
upvoted 0 times
...
Loren
3 months ago
I'm a bit confused on this one. I know we need to make sure our observer runs after the third-party one, but I'm not sure if setting the sort order is the right approach. Hmm, let me think this through a bit more.
upvoted 0 times
...
Charolette
4 months ago
I think the answer is B. Setting the sort order of the new observer to be less than the third-party vendor's observer should ensure my observer runs after theirs.
upvoted 0 times
...

Save Cancel