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 Exam AD0-E704 Topic 11 Question 52 Discussion

Actual exam question for Adobe's AD0-E704 exam
Question #: 52
Topic #: 11
[All AD0-E704 Questions]

Suppose there are 3 classes: Class A, B and C. Class C have dependecy of Class A You need to overrride/change an argument of class A, create an object of it and inject in Class B in such a way that it should not affect the class C. What should be the magento standard way to do this:

Show Suggested Answer Hide Answer
Suggested Answer: B, C

Contribute your Thoughts:

Marvel
5 days ago
A is definitely the way to go. I can't believe anyone would think to use config.xml, system.xml, or menu.xml for this. That would be like trying to change your oil in the microwave.
upvoted 0 times
...
Tamra
12 days ago
I agree with Joesph. The Magento standard way is to use di.xml to define the virtual type and then pass the subclass of A into class B.
upvoted 0 times
...
Joesph
23 days ago
Hmm, this seems straightforward. I think A is the correct answer, as it mentions using di.xml to override the argument and create a subclass of A, which can then be injected into class B.
upvoted 0 times
Linsey
5 days ago
Yes, using di.xml to override the argument and create a subclass of A is the standard approach.
upvoted 0 times
...
Goldie
8 days ago
I agree, option A is the correct way to do it.
upvoted 0 times
...
...
Ardella
1 months ago
I'm not sure, but after thinking about it, I also believe option A is the best choice. It follows the standard Magento practices for dependency injection.
upvoted 0 times
...
Erin
1 months ago
I agree with Rossana. Option A seems like the correct approach to override the argument of class A and inject it into class B without affecting class C.
upvoted 0 times
...
Rossana
1 months ago
I think the magento standard way to do this is option A.
upvoted 0 times
...

Save Cancel
a