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:

Boris
3 months ago
Haha, Marvel's right. Using the wrong file would be like trying to bake a cake in the dishwasher. A is the clear winner here.
upvoted 0 times
Alida
1 months ago
Exactly, we don't want any unexpected consequences by using the wrong file.
upvoted 0 times
...
Fatima
2 months ago
Yeah, that's the correct way to do it. It ensures that Class C is not affected.
upvoted 0 times
...
Alpha
2 months ago
A) In module's etc/di.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
upvoted 0 times
...
...
Marvel
3 months 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
Cammy
2 months ago
A) In module's etc/di.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
upvoted 0 times
...
Rebecka
2 months ago
Yeah, using di.xml is the standard way to override arguments and inject objects. It keeps things clean and organized.
upvoted 0 times
...
Carla
2 months ago
A) In module's etc/di.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
upvoted 0 times
...
...
Tamra
3 months 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
Sharmaine
2 months ago
Yes, that's the Magento standard way to handle the dependency without affecting Class C.
upvoted 0 times
...
Chantell
2 months ago
I think that's the correct way to do it.
upvoted 0 times
...
Sanda
2 months ago
A) In module's etc/di.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
upvoted 0 times
...
...
Joesph
4 months 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
3 months ago
Yes, using di.xml to override the argument and create a subclass of A is the standard approach.
upvoted 0 times
...
Goldie
3 months ago
I agree, option A is the correct way to do it.
upvoted 0 times
...
...
Ardella
4 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
4 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
4 months ago
I think the magento standard way to do this is option A.
upvoted 0 times
...

Save Cancel