Tuesday

Understanding SDP vs. ADP in Oracle VBCS: The Ultimate Guide


In Oracle Visual Builder Cloud Service (VBCS), data handling is the backbone of any robust application. If you’ve spent any time in the Designer, you’ve likely encountered two heavy hitters: Service Data Provider (SDP) and Array Data Provider (ADP).

Choosing the wrong one isn't just a technical "oops"—it can lead to sluggish performance, broken pagination, or UI components that refuse to refresh. Let's break down the differences, the use cases, and how to choose the right tool for the job.


What is a Service Data Provider (SDP)?

The Service Data Provider (SDP) is a specialized variable type designed specifically to bind UI components (like Tables or Lists) directly to a REST API. It is "service-aware," meaning it handles the heavy lifting of communication between your front-end and your back-end services.

Key Features of SDP:

  • Automatic Fetching: You don’t need to write a "fetch" action chain. When the page loads, the SDP automatically calls the REST endpoint.

  • Server-Side Logic: It natively supports server-side filtering, sorting, and pagination.

  • Built-in State Management: It tracks the "busy" state, error states, and fetch status automatically.

The SDP Philosophy: "Let the server do the work." Use SDP when you have thousands of records and only want to fetch what the user sees.


What is an Array Data Provider (ADP)?

The Array Data Provider (ADP) is a wrapper for a client-side array. Unlike the SDP, the ADP doesn't care where the data comes from. You could fetch data from a REST API, hardcode it, or calculate it on the fly; once that data is in an array, the ADP makes it "observable" so the UI can display it.

Key Features of ADP:

  • Client-Side Control: You have full control over the data. You can add, remove, or update items in the array locally without calling the server.

  • Manual Management: You are responsible for fetching the data (usually via a "Call REST" action) and assigning it to the ADP variable.

  • Flexibility: Perfect for data that needs to be manipulated (e.g., a shopping cart or a multi-row editable table).


SDP vs. ADP: The Comparison Table

FeatureService Data Provider (SDP)Array Data Provider (ADP)
Data SourceDirect link to a REST Service.A local Javascript Array.
PaginationServer-side. Fetches data in chunks.Client-side. All data must be loaded at once.
Filtering/SortingPerformed by the REST API (Back-end).Performed in the browser (Front-end).
Data ManipulationDifficult; requires service-level changes.Easy; just update the local array.
PerformanceBest for large datasets.Best for small, static, or highly interactive lists.

Real-World Examples

Scenario 1: The "Employee Directory" (Use SDP)

Imagine an HR portal with 10,000 employees. You need a table with searching and sorting.

  • Why SDP? You don't want to download 10,000 records into the user's browser. With SDP, when the user searches for "John," the SDP sends a query to the database, and only the relevant 10-20 results are downloaded.

Scenario 2: The "Expense Report Line Items" (Use ADP)

Imagine a user creating a new expense report. They click "Add Row" to add different expenses before hitting "Submit."

  • Why ADP? The data doesn't exist on the server yet. The user is creating it locally. Using an ADP allows you to add, edit, and delete rows in the UI instantly. Once the user is finished, you can send the entire ADP array to the server in one go.


When to Choose Which?

Choose SDP if:

  1. You are displaying data directly from a REST API.

  2. The dataset is large (over 50–100 records).

  3. You need automatic pagination (infinite scroll).

Choose ADP if:

  1. You need to manipulate the data locally (edit/add/delete) before saving.

  2. You are combining data from multiple sources into one list.

  3. The dataset is small and static (like a list of countries or status codes).

Summary

The SDP is your go-to for read-heavy views with large datasets, while the ADP is the hero of interactive, transactional UI components. Understanding this distinction is the first step toward building high-performance Oracle Visual Builder applications.


Expert Tip: If you ever find yourself needing the best of both worlds—like a large table that is also editable—consider using a Buffering Service Data Provider or managing a "dirty state" alongside your SDP!

No comments:

Post a Comment