Plat-Dev-201 practice question 23 of 30
A developer creates a Lightning web component that imports a method within an Apex class. When a Validate button is pressed, the method runs to execute complex validations. In this implementation scenario, which two options are.. of the Controller according to the MVC architecture? Choose 2 answers
Full set: 204 questionsIn the Model-View-Controller (MVC) architecture as applied to Lightning Web Components, the controller is responsible for handling user input and mediating between the Model (data) and the View (UI). The JavaScript file (.js) acts as the client-side controller, managing events and component state. The Apex class (.cls) functions as the server-side controller, executing business logic and accessing the database (the Model).
A. The HTML file (.html) defines the structure and presentation of the component, making it the View in the MVC pattern.
D. The XML file (.js-meta.xml) is a configuration file that defines metadata for the component, such as its visibility in the Lightning App Builder. It is not part of the MVC architecture.
1. Lightning Web Components Dev Guide, "Component Architecture". The guide describes the roles: HTML for the view, JavaScript for the controller logic, and Apex for server-side control and data access.
2. Trailhead, "Lightning Web Components Basics" module, "Create a Lightning Web Component" unit. It explains, "The HTML file provides the structure for your component. The JavaScript file defines the core business logic and event handling. The XML file defines the metadata values for the component."
3. Salesforce Architects, "Architect's Guide to Building Forms on Salesforce", section "Lightning Web Components". It describes LWC's architecture, mapping the JavaScript to the client-side controller and Apex to the server-side controller.
Keep practicing
Take the free Plat-Dev-201 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Plat-Dev-201 practice questions
- Question 1Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightn…
- Question 2Which two statements are true about using the @testSetup annotation in an Apex test class…
- Question 3Managers at Universal Containers want to ensure that only decommissioned containers are a…
- Question 4Universal Containers has a Visualforce page that displays a table of every Container__c b…
- Question 5A developer is alerted to an issue with a custom Apex trigger that is causing records to …
- Question 6Which two operations affect the number of times a trigger can fire? Choose 2 answers
