Choosing Between SDP And ADP In Oracle VBCS
Conneqtion Group
Oracle Cloud Infrastructure & Oracle SaaS Implementation Partner
In this blog, we will cover the key points of difference between a Service Data Provider (SDP) and an Array Data Provider (ADP) by creating a VBCS application. So, let’s begin.
Requirements to perform the operation:
Real-time Array Data Provider (ADP) use cases:
In an editable table using ArrayDataProvider (ADP), the user may alter particular column data and update it in the ATP table through a rest API, by refreshing the page, new data will appear in UI.
Create one variable whose type is “array of objects” and then we can use that variable in ADP under “bind data to variable”, by using this user is able to fetch the data automatically in dropdown without the use of any API/action chain when they run the application.
The below image shows “expenseArray” and usage of this array in “myExpensesADP” and those data is displayed in the dropdown.
“myExpensesADP” is the ADP used in below mentioned expenses type field.
The below image is related to editable functionality and delete action for selected columns.
ADP variable properties are different than SDP in VBCS.? In ADP, we have two possibilities for assigning data, as shown in the image below. Moreover, unlike SDP, there are no parameters such as filter criteria, page criteria, or sort criteria in ADP.
Real-time Service Data Provider (SDP) use cases:
In the below image, fetching data by using SDP and displayed in dropdown.
Pagination using Service Data Provider (SDP)
SDP automatically retrieves data when the relevant UI component renders, there is no requirement for an action chain to retrieve the data, even if it includes parameters such as filter criteria and sort criteria.
This allows the user to filter/sort the data based on their condition.
To understand the difference, let us create an Oracle VBCS application with a single page to showcase the difference between a Service Data Provider (SDP) and an Array Data Provider (ADP).
In the scope of this blog, we are using the Oracle REST Data Services (ORDS) connection to fetch data from the ATP database. The connection is already created.
Step 1: Let’s create the type for SDP (Service Data Provider).
Step 2: Create the type from endpoint.
Step 3: Define the type -name and whenever you are creating a data provider as SDP then create it from the endpoint Root which is shown in the image below.
领英推荐
Step 4: Create the variable by adding the earlier created type “getEmp”. Then, set the key attribute.
Step 5: Similarly, we are creating a type for ADP defining type name “getEmpData” and here we have not enabled the “create from endpoint Root”. This is a key difference between ADP and SDP.
Required fields are to be selected from items.
Step 6: In Type, we can see the difference of ADP used type = getEmpData and SDP used type getEmp.
In ADP we can assign data in 2 ways:
a) Assign data later. b) Bind Data to variable.
a) In Assign data later, we are adding item type from endpoint type, and to fetch data we need an event in this case ‘VB Enter’.
b) In Bind data to a variable, we create an array of object variables, in that variable we will define an array of object types of data. These are already defined/fixed values. We don’t need to call any API or action to fetch those data.
Step 7: We have created two tables in a single page, one for SDP and the other for ADP.
Step 8: Inside the table properties, data added in created SDP variable and selecting required fields.
After applying data and column selection, it is possible to fetch the data because of SDP, there is no need of an action or event for SDP to load the data as this is one of the features of SDP. It automatically fetches data from endpoint.
Step 9: Similarly, we did the same thing for ADP and added ADP variable inside table properties data and selected same columns which we selected for SDP.
For both ADP and SDP, we are using the same endpoint/ table from ATP, but in the UI, ADP table is not displaying any data. In the image below, ADP table displayed “No data to display.”
Step 10: Now, let’s create an action to fetch the data from ATP to display in the ADP table, where the action name is onPageLoad and the used event is vbEnter.
Step 11: In the action, we called get REST API and pass the result to ADP data variable.
Step 12: This is the result after the implementation of the action. Here, we run the page and on page load, we are fetching data from ATP to pass it to the ADP variable. Now, that data is displayed in the second table as shown in the image below.
Below are the Key Differences between them: –
If you have any questions or concerns, please let us know in the comments section or write to us at [email protected].