How do you implement the common functionality in the event observers, keeping maintainability and testability in mind?

You are implementing a customization of the sales management within a module MyCompany_MySalesProcess. You have created several event observers to add the custom functionality. Each observer is a separate class, but they require some common functionality.

How do you implement the common functionality in the event observers, keeping maintainability and testability in mind?
A . You create a trait with the common methods and use the trait in the observer classes.
B . You create an abstract class AbstractObserver with the common methods and extend the observer classes from it.
C . You create a regular class implementing the common functionality as public static methods and call those from the observers.
D . You create a regular class implementing the common functionality as public methods and use constructor injection to make them available to the observers.

Answer: D

Latest AD0-E709 Dumps Valid Version with 135 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments