ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 38 - AD0-E718 discussion

Report
Export

An Adobe Commerce Architect runs the PHP Mess Detector from the command-line interface using the coding standard provided with Adobe Commerce. The following output appears:

The Architect looks at the class and notices that the constructor has 15 parameters. Five of these parameters are scalars configuring the behavior of Kyservice.

How should the Architect fix the code so that it complies with the coding standard rule?

A.
Introduce a new class accepting those five scalars and use it in the constructor and the remaining logic of Myservice
Answers
A.
Introduce a new class accepting those five scalars and use it in the constructor and the remaining logic of Myservice
B.
Modify the code of Myservice so the number of different classes, interfaces, and scalar types used as parameters in the constructor and other methods is less than 13
Answers
B.
Modify the code of Myservice so the number of different classes, interfaces, and scalar types used as parameters in the constructor and other methods is less than 13
C.
Modify the code of Myservice so that the number of different classes and interfaces referenced anywhere inside the class is less than 13
Answers
C.
Modify the code of Myservice so that the number of different classes and interfaces referenced anywhere inside the class is less than 13
Suggested answer: A

Explanation:

The best way to fix the code so that it complies with the coding standard rule is to introduce a new class accepting those five scalars and use it in the constructor and the remaining logic of Myservice.

This will reduce the number of different classes, interfaces, and scalar types used as parameters in the constructor and other methods to less than 13, which is the limit set by the coding standard.

Additionally, any extra code that is not necessary can be removed to reduce the general complexity of the class and improve readability.

asked 02/10/2024
Albert Smith
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first