Free AD0-E717 Exam Braindumps (page: 5)

Page 5 of 20

A developer is creating a class \Vendor\Module\Model\MyModeL How should that class be defined as transient in di.xml?

  1. <type name="\Vendor\Module\Model\MyModer transient="true7>
  2. <type name="\Vendor\Module\Model\MyModer singleton='false7>
  3. <type name='\Vendor\Module\Model\MyModer shared="false7>

Answer(s): A

Explanation:

To define a class as transient in di.xml, the transient attribute should be set to true.

Code snippet

<type name="\Vendor\Module\Model\MyModel" transient="true">



Under which section should the soft dependency for a module be listed in app/code/<Vendor>/<Module>/composer.json file?

  1. suggest*: {
  2. }
    optional": {
  3. }
    soft": {
  4. }

Answer(s): C

Explanation:

The soft dependency for a module should be listed in the soft section of the app/code/<Vendor>/<Module>/composer.json file.

{

"name": "Vendor/Module",

"description": "This is a sample module",

"type": "magento2-module",

"version": "1.0.0",

"require": {

"php": "~7.3.0",

"magento/framework": "^2.4.0",

"soft": {

"magento/module-catalog": "^2.4.0"

}

}

}



How can a developer override a core class method in Adobe Commerce?

  1. <preference for='Magento\Catalog\Block\Product" type="Vendor\Module\Block\Producf />
  2. <typename="Magento\Catalog\Block\Product"> q <rewrite class="Vendor\Module\Block\Producf /> </type>
  3. <typename="Magento\Catalog\Block\Product*> <arguments> q <argument name="rewrtte" xsi:type="object">Vendor\Module\Block\Product</argument> </arguments> </type>

Answer(s): A

Explanation:

The preference element in di.xml allows specifying a custom class that will be used instead of the original class when creating an object. This can be used to override a core class method by extending the original class and overriding the method in the custom class. The rewrite and argument elements are not valid for overriding core class methods in di.xml.



Which command can be used to display a full list of enabled and disabled Magento modules?

  1. bin/magento module:all
  2. bin/magento modulestatus
  3. bin/magento module:show

Answer(s): B

Explanation:

The command bin/magento modulestatus displays the status of all modules, including enabled and disabled ones. The command bin/magento module:all is not valid, and the command bin/magento module:show displays information about a specific module.



Page 5 of 20



Post your Comments and Discuss Adobe AD0-E717 exam with other Community members:

Christine commented on November 06, 2024
Good for practice
Anonymous
upvote

Xiching commented on August 20, 2024
Thank you for publishing these questions. I assisted me to pass my exam.
China
upvote