Adobe AD0-E134 Practice Test - Questions Answers, Page 3
List of questions
Question 21
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
An AEM Developer needs to create a new component to help support a new product launch.
• The client is on AEM 6.5 on-premise with the latest version of WCM Core Components
• The component must include text, image, and a link
• The component must support multiple designs
Which process should the AEM Developer use to support the launch?
Explanation:
Extend the Teaser Component from Core Components
Create style variations to be used in the Style System** Comprehensive Explanation of Correct Answer Only: The Teaser Component from Core Components is a component that allows authors to display a title, description, image and link for a teaser item. The component supports multiple designs and can be extended to add custom features or logic. The Style System allows authors to define style variations for components without requiring code changes or new templates. Reference:
https://experienceleague.adobe.com/docs/experience-manager-corecomponents/ using/components/teaser.html?lang=en
https://experienceleague.adobe.com/docs/experience-manager-corecomponents/ using/components/style-system.html?lang=en
Question 22
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
An AEM application is expected to export a content fragment in JSON format without any customization for a headless implementation.
What is the recommended approach?
Explanation:
AEM Assets HTTP API is a RESTful API that allows access to content fragments in JSON format without any customization. The API supports CRUD operations on content fragments and their variations, as well as querying and searching for content fragments based on metadata or full-text search. Reference: https://experienceleague.adobe.com/docs/experience-manager- 65/assets/extending/assets-api-content-fragments.html?lang=en
Question 23
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
In a non-optimized website, the final HTML generated for a typical page by publish instance includes a relatively large number of <script> elements that refer to other script files loaded from AEM environment. The developer wants to minimize these network calls by combining all required client library code into a single file to reduce the number of back-and-forth requests on page load.
Which step should a developer take to solve this issue?
Explanation:
The embed property of the cq:ClientLibraryFolder node allows embedding code from a client library into another client library. At runtime, the generated JS and CSS files of the embedding library include the code of the embedded library. This reduces the number of network calls and improves performance. Embedding code is useful for providing access to libraries that are stored in secured areas of the repository. Reference: https://experienceleague.adobe.com/docs/experience-managercloud- service/content/implementing/developing/full-stack/clientlibs.html?lang=en#embed
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/embed-propertyin- client-libs/m-p/426858
Question 24
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
An AEM application development team is assigned a task to create an Event-Driven Data Layer implementation for an Analytics solution.
Which Adobe recommended best practice should the developer choose?
Explanation:
Adobe Client Data Layer is a JavaScript library that provides a standardized way to collect, structure, and manage data on a web page. It can be used to implement an event-driven data layer for analytics solutions. It integrates with Core components and allows authors to configure data layer properties for each component. It also supports custom events and data sources. Reference:
https://experienceleague.adobe.com/docs/experience-manager-corecomponents/ using/developing/data-layer.html?lang=en https://github.com/adobe/adobe-clientdata- layer
Question 25
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
A developer is on an AEM application that is being used to calculate an employee's salary. The calculation is done in an OSGi service called CalculationService. This service class has a dependency on one other service, called the EmployeeService.
How should the developer make sure that the critical code in the CalculationService has a high unit test coverage?
Explanation:
A mock framework is a tool that allows creating mock objects that simulate the behavior of real objects in a controlled way. A mock framework can be used in a unit test to inject the
EmployeeService dependency into the CalculationService and verify its interactions. This way, the unit test can focus on testing the logic of the CalculationService without relying on the actual implementation of the EmployeeService. Reference:
https://sling.apache.org/documentation/development/sling-testing-tools.html
https://wcm.io/testing/aem-mock/usage.html
Question 26
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
An AEM Developer receives requirements for Sling Models in a human-readable yaml format. A custom application needs to be built. The dependency is as shown:
Explanation:
To create Sling Models that can export data in a human-readable yaml format, the following steps are required:
Create Sling models to export as yaml. Sling models are Java classes that can be used to represent resources in AEM. Sling models can use annotations to define how they can be adapted from a resource and how they can export data in different formats. To export data in yaml format, the Sling model class needs to use the @Model annotation with the resourceType parameter set to the resource type of the resource that the model represents. The Sling model class also needs to implement the org.apache.sling.models.annotations.Exporter annotation with the name parameter set to "jackson" and the extensions parameter set to "yaml". The Sling model class also needs to use the @JsonProperty annotation on the fields or methods that need to be exported in yaml format. Configure mime type in Apache Sling MIME Type Service. The Apache Sling MIME Type Service is an OSGi service that maps file extensions to MIME types and vice vers a. To enable the yaml format for Sling models, the MIME Type Service needs to be configured with a new entry for the yaml extension and its corresponding MIME type, which is "application/x-yaml". This can be done by creating an OSGi configuration for the org.apache.sling.commons.mime.internal.MimeTypeServiceImpl service and adding the entry "yaml=application/x-yaml" to the mime.types property. Reference:
https://sling.apache.org/documentation/bundles/models.html
https://sling.apache.org/documentation/bundles/mime-type-support-commons-mime.html
Question 27
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
A developer needs to create a workflow custom process step in AEM. In a custom process step, an OSGi component needs to implement the WorkflowProcess interface.
Which method should the developer implement?
Explanation:
The WorkflowProcess interface is the interface to be used for automatic workflow steps implemented in Java. Classes implementing this interface define Java based processes that can be attached to a WorkflowNode and executed by the workflow engine. The method execute takes a WorkItem, a WorkflowSession and a MetaDataMap as parameters and performs the logic of the custom process step. Reference: https://developer.adobe.com/experience-manager/referencematerials/6-5/javadoc/com/adobe/granite/workflow/exec/WorkflowProcess.html
https://experienceleague.adobe.com/docs/experience-manager-learn/forms/adaptiveforms/custom-process-step-aem-workflow.html?lang=en
Question 28
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
A customer adds third-party client libraries to add some features in an existing AEM application, which will significantly reduce performance.
How should the developer optimize the site?
Explanation:
Embedding client libraries is a technique that allows combining code from multiple client libraries into a single file. This reduces the number of network requests and improves performance.
Embedding client libraries can be done by using the embed property of the cq:ClientLibraryFolder node and specifying the categories of the client libraries to be embedded. Reference:
https://experienceleague.adobe.com/docs/experience-manager-cloudservice/ content/implementing/developing/full-stack/clientlibs.html?lang=en#embed
https://experienceleague.adobe.com/docs/experience-manager- 65/developing/introduction/clientlibs.html?lang=en#embedded-files
Question 29
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
A snippet throws an exception at runtime:
@Model(adaptables = {Resource.class}) public class MyCustomModel {
(SSIingObject
private Resource resource;
What should the developer add to fix it?
Explanation:
The developer should add the defaultInjectionStrategy = DefaultInjectionStrategy property to the @Model Class annotation to fix the snippet. The defaultInjectionStrategy property defines how the Sling Model handles missing or null values for the injected fields. By default, the Sling Model uses the REQUIRED injection strategy, which means that all fields must have a non-null value or else an exception is thrown. By setting the defaultInjectionStrategy property to OPTIONAL, the Sling Model allows null values for the injected fields and does not throw an exception. This way, if the page field is null because the resource is not a page, the Sling Model can still work without errors. Reference:
https://sling.apache.org/documentation/bundles/models.html
https://sling.apache.org/documentation/bundles/models.html#optional-injection
Question 30
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
Which two unit testing dependencies are generated by AEM archetype? (Select two.)
Explanation:
JUnit and Mockito are two unit testing dependencies that are generated by AEM archetype. JUnit is a framework for writing and running unit tests in Java. Mockito is a framework for creating and using mock objects in unit tests. AEM archetype also adds Apache Sling Mocks and AEM Mocks Test Framework by io.wcm as dependencies for unit testing. Reference:
https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wkndtutorial- develop/project-archetype/unit-testing.html?lang=en
https://experienceleague.adobe.com/docs/experience-manager-corecomponents/ using/developing/archetype/using.html?lang=en
Question