Reactive Programming Model Flashcards

1
Q

Which of the following events is NOT available in Screens or Blocks?

A. Initialize
B. Ready
C. After Fetch
D. Render

A

C. After Fetch (This is an Aggregate event, not a Screen event)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Considering the Initialize event of a Screen, which of the following would be the BEST use case for that event?

A. Retrieve data from the server database.
B. Act on data returned by a Data Action.
C. Manipulate the DOM.
D. Set the default value of a Local Variable.

A

D. Set the default value of a Local Variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a primary reason for using the On Ready event instead of On Initialize for certain actions?

A. On Ready is triggered before any data fetching, making it faster.
B. On Ready allows you to access and manipulate the DOM.
C. On Ready can be used to set input parameters of Blocks on the screen.
D. On Ready always executes before any user interaction with the screen.

A

B. On Ready allows you to access and manipulate the DOM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is the CORRECT order of occurrence of events in a Screen?

A. Initialize, Ready, Render, Destroy.
B. Initialize, Destroy, Ready, Render.
C. Ready, Initialize, Render, Destroy.
D. Initialize, Render, Ready, Destroy.

A

A. Initialize, Ready, Render, Destroy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When does the On Destroy event of a Screen trigger?

A. Immediately after the On Initialize event of the next screen.
B. Before the On Ready event of the next screen.
C. After the screen transition to the next screen is complete.
D. When the user closes the browser window.

A

C. After the screen transition to the next screen is complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why might the On Render event be triggered multiple times during a user’s interaction with a screen?

A. Because the user is rapidly clicking on different elements of the screen.
B. Because the screen contains multiple Aggregates that fetch data independently.
C. Because changes in data or screen elements can trigger a re-rendering of the screen.
D. Because the On Render event is automatically triggered every few seconds.

A

C. Because changes in data or screen elements can trigger a re-rendering of the screen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In which scenario is the On After Fetch event particularly useful?

A. When you need to validate user input before submitting a form.
B. When you need to perform calculations based on data fetched by an Aggregate.
C. When you need to redirect the user to a different screen based on fetched data.
D. When you need to set the default value of a dropdown widget based on the first record in an Aggregate.

A

B. When you need to perform calculations based on data fetched by an Aggregate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which event is the BEST place to handle logic that needs to run after all data has been fetched and the screen is fully displayed to the user?

A. On Initialize
B. On Ready
C. On Render
D. On Destroy

A

C. On Render (though keep in mind it might run multiple times)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a key difference between Screen Events and Block Events?

A. Screen Events only handle user interactions, while Block Events handle data changes.
B. Screen Events are triggered on the client-side, while Block Events are triggered on the server-side.
C. Screen Events define the lifecycle of a screen, while Block Events allow for communication between a block and its parent.
D. Screen Events can have input parameters, while Block Events cannot.

A

C. Screen Events define the lifecycle of a screen, while Block Events allow for communication between a block and its parent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the BEST way to prevent a user from accessing a screen if they are not authenticated?

A. Use the On Destroy event to redirect them to the login screen.
B. Check their authentication status in the On Initialize event and redirect if necessary.
C. Hide the screen elements that require authentication using conditional visibility.
D. Display an error message in the On Ready event if the user is not logged in.

A

B. Check their authentication status in the On Initialize event and redirect if necessary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following events is triggered when the screen starts rendering, but before it is visible to the end-user?
A) Initialize
B) Ready
C) Render
D) After Fetch

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In which event can you safely manipulate the DOM since it is already loaded but not yet visible to the end-user?
A) Initialize
B) Ready
C) Render
D) Destroy

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the best use case for the On Render event?
A) Set default values for variables
B) Add JavaScript listeners to DOM elements
C) React to changes in the data and update the UI accordingly
D) Redirect the user to another screen

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What event should you handle to clean up DOM changes or remove JavaScript listeners when a screen is about to be destroyed?
A) After Fetch
B) Render
C) Destroy
D) Ready

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a typical use case for the On Initialize event of a Screen?
A) Set JavaScript listeners on the DOM elements
B) Handle the data returned from an Aggregate
C) Set default values for Local Variables
D) Clean up resources before the screen is destroyed

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following is not a use case for the After Fetch event?
A) Chain aggregates that depend on each other
B) Act on the results returned by an Aggregate
C) Set JavaScript listeners on DOM elements
D) Check if the returned data is empty

A

C

15
Q

Which event would be the best to handle a redirect to another screen if a user is not authenticated?
A) Initialize
B) Ready
C) Render
D) Destroy

A

A

16
Q

Which of the following options is FALSE regarding Screen Aggregates?

A. The Render Event on the Screen is triggered when an Aggregate with the Fetch property set to “only on demand” finishes its execution.
B. A Screen Aggregate can be triggered when a screen is initializing or Only On Demand.
C. All Aggregates, by default, have the Fetch property set to On Demand.
D. The On After Fetch Event is triggered for every Aggregate, regardless of its Fetch property.

A

C. All Aggregates, by default, have the Fetch property set to On Demand. (False)

The default Fetch property for Aggregates is “At Start.”

17
Q

What is the MAIN benefit of using the “Only On Demand” Fetch property for an Aggregate?

A. It allows you to control the exact moment when data is fetched, potentially improving performance.
B. It simplifies the development process by eliminating the need for Refresh Data elements.
C. It enhances application security by restricting data access until explicitly requested.
D. It ensures that all Aggregates on a screen are executed in a specific order.

A

A. It allows you to control the exact moment when data is fetched, potentially improving performance.

18
Q

Consider an Aggregate with the Fetch property set to Only On Demand. When does that Aggregate run?

A. Automatically, when the Screen is initializing.
B. Programmatically, using a Refresh Data node in a Screen Action.
C. Automatically, when the Aggregates set to run “At Start” finish.
D. Programmatically, using a Server Action.

A

B. Programmatically, using a Refresh Data node in a Screen Action.

19
Q

What element is used to trigger a Screen Aggregate that is set to “Only On Demand”?

A. A Trigger Event element.
B. A Refresh Data element.
C. A Wait element.
D. A CreateOrUpdate entity action.

A

B. A Refresh Data element.

20
Q

In which scenario is it generally MORE appropriate to use the “Only On Demand” Fetch property for an Aggregate?

A. When displaying a large amount of data that is needed immediately upon screen load.
B. When fetching data that is dependent on user input or actions.
C. When the Aggregate is used in multiple places throughout the application.
D. When the Aggregate performs complex calculations that can potentially slow down screen rendering.

A

B. When fetching data that is dependent on user input or actions.

21
Q

Does setting an Aggregate to “Only On Demand” affect its asynchronous execution behavior?

A. Yes, the Aggregate will run synchronously when triggered.
B. No, the Aggregate will still run asynchronously when triggered.
C. It depends on the specific logic within the Aggregate itself.
D. “Only On Demand” Aggregates can only be executed synchronously.

A

B. No, the Aggregate will still run asynchronously when triggered.

22
Q

Which event can be used to perform actions AFTER a “Only On Demand” Aggregate has finished fetching data?

A. The Screen’s On Initialize event.
B. The Aggregate’s On After Fetch event.
C. The Screen’s On Ready event.
D. The Screen’s On Render event.

A

B. The Aggregate’s On After Fetch event.

23
Q

What is a potential DOWNSIDE of using the “Only On Demand” Fetch property excessively?

A. It can lead to a more complex application logic flow.
B. It can increase the number of server requests, potentially impacting performance.
C. It can make it harder to debug data-related issues.
D. All of the above.

A

D. All of the above.

24
Q

If you have two Screen Aggregates, one set to “At Start” and the other to “Only On Demand,” which one will be executed first?

A. The Aggregate set to “At Start.”
B. The Aggregate set to “Only On Demand.”
C. They will both be executed simultaneously.
D. It depends on which one is placed higher in the screen’s hierarchy.

A

A. The Aggregate set to “At Start.”

25
Q

What is the BEST approach to determine if an Aggregate should be set to “At Start” or “Only On Demand”?

A. Always use “Only On Demand” to optimize performance.
B. Always use “At Start” for simplicity.
C. Consider the specific requirements of the screen and the nature of the data being fetched.
D. Consult the OutSystems documentation for recommended best practices.

A

C. Consider the specific requirements of the screen and the nature of the data being fetched.

26
Q

When would it be appropriate to set a Screen Aggregate’s Fetch property to Only On Demand?
A) When the data needs to be fetched immediately when the screen initializes.
B) When the data is only needed after a user interaction, such as clicking on a list item.
C) When the data is required to render the screen immediately.
D) When the Aggregate should be refreshed every time the screen re-renders.

A

B

26
Q

Which of the following options is true about the Fetch property set to At Start for a Screen Aggregate?
A) The Aggregate runs automatically when the screen is initializing.
B) The Aggregate runs only when triggered programmatically.
C) The Aggregate will not trigger the Render event.
D) The Aggregate can only run after all other Aggregates are complete.

A

A

27
Q

How can an Aggregate with the Fetch property set to Only On Demand be triggered programmatically?
A) By placing it inside a Server Action
B) By using a Refresh Data element in a Screen Action
C) By setting a default value in the Aggregate
D) By using a Submit Button in the UI

A

B

27
Q

In a scenario where a Screen has two Aggregates with the Fetch property set to At Start, what happens?
A) The Aggregates run sequentially, one after the other.
B) The Aggregates run asynchronously and in parallel.
C) Only one Aggregate will run, depending on the data source.
D) The Aggregates are triggered by the parent screen logic.

A

B

28
Q

What happens to the screen when an Aggregate set to At Start finishes fetching data?
A) The screen re-renders automatically to display the new data.
B) The screen requires a manual refresh to show the updated data.
C) The screen logic triggers the next Screen Action.
D) The screen continues without re-rendering.

A

A

29
Q

What would be a good reason to set an Aggregate’s Fetch property to Only On Demand?
A) When the data fetched by the Aggregate is too large to be loaded at the start.
B) When the data is required immediately upon screen load.
C) When the Aggregate must run before the DOM is ready.
D) When no data is required for user interaction.

A

A

30
Q

Which of the following options is true regarding the On After Fetch event in a Screen Aggregate?
A) It is only triggered if the Fetch property is set to Only On Demand.
B) It is triggered after an Aggregate finishes, regardless of how it was triggered.
C) It is triggered before the screen renders.
D) It is triggered only for Aggregates running at start.

A

B

31
Q

Which of the following is false about Aggregates in OutSystems?
A) Aggregates run asynchronously and in parallel by default when the Fetch property is set to At Start.
B) Aggregates with the Fetch property set to Only On Demand run automatically when the screen initializes.
C) The Refresh Data element is used to trigger an Aggregate set to Only On Demand.
D) The screen re-renders when an Aggregate completes fetching data.

A

B