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 2 Question 57 Discussion

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

An Adobe Commerce developer is developing a custom module. As part of their implementation they have decided that all instances of their Custom\Module\Model\Example class should receive a new instance of Magento\Filesystem\Adapter\Local.

How would the developer achieve this using di. xml?

A)

B)

C)

Show Suggested Answer Hide Answer
Suggested Answer: B

The developer can achieve this by adding the following configuration to their di.xml file:

XML

<config>

<component name='CustomModuleModelExample' factory='CustomModuleModelExampleFactory'>

</component>

</config>

This configuration will ensure that all instances of the CustomModuleModelExample class will receive a new instance of the MagentoFilesystemAdapterLocal class.


Contribute your Thoughts:

0/2000 characters
Denae
5 days ago
I'm leaning towards Option B, but I can't recall if we need to use `` for the constructor parameters.
upvoted 0 times
...
Izetta
10 days ago
I practiced a similar question where we had to inject a different class, and I think it involved using the `` tag.
upvoted 0 times
...
Skye
15 days ago
I think I remember that we need to define the preference in di.xml, but I'm not entirely sure how to specify the arguments correctly.
upvoted 0 times
...

Save Cancel