BTPbeginner

SAPUI5 Fundamentals & MVC Architecture

The core JavaScript framework underlying Fiori apps - views, controllers, models, and data binding.

SAPUI5 fundamentals are the baseline every Fiori/BTP frontend developer interview checks first, since Fiori Elements (covered elsewhere) is built entirely on top of SAPUI5, and a candidate who can't explain the underlying MVC pattern and data binding model will struggle the moment a requirement needs custom, freestyle UI5 development beyond what Fiori Elements templates can express.

SAPUI5's data binding is like a live shared whiteboard where erasing and rewriting one copy (the model) instantly updates every other linked screen (view controls) showing the same information, rather than manually walking around updating each separate whiteboard by hand every time something changes.

Key Concepts

1
SAPUI5 (and its open-source sibling OpenUI5) follows a strict Model-View-Controller pattern: a view (typically declared in XML, though JS and JSON view types also exist) declares the UI structure using SAPUI5's rich control library (sap.m for mobile-first responsive controls like Table, List, Button), a controller (a JavaScript file paired one-to-one with a view) handles event logic and lifecycle hooks (onInit, onBeforeRendering, onAfterRendering), and a model holds the actual data, bound to view controls through SAPUI5's data binding syntax so UI elements automatically update when the underlying model data changes, without manual DOM manipulation.
sap.mTableListButtononInit
2
SAPUI5 supports several model types for different purposes: the JSON model (simple client-side data, good for local view state), the OData model (V2 or V4, the most common for real Fiori apps, handling batch requests, automatic $expand, and built-in create/update/delete operations against a backend OData service), and the Resource model (for i18n text bundles, keeping UI labels translatable and separated from view logic). Binding itself comes in two flavors worth distinguishing clearly: one-way binding (model changes update the view, but view changes don't propagate back automatically) and two-way binding (changes flow both directions, essential for editable input fields bound directly to a model property).
$expand
3
A senior-level answer covers the component-based application structure (Component.js bootstrapping the app, manifest.json declaring routing, models, and dependencies declaratively rather than imperatively in code - itself a significant SAPUI5 architectural principle, since manifest-driven configuration is what lets tooling and the Fiori Launchpad understand an app's structure without executing its code), and fragments (XMLFragment, reusable partial views like a common dialog, useful for avoiding duplicated view markup across multiple screens) as the practical building blocks beyond a single view/controller pair that any non-trivial UI5 application ends up needing.
Component.jsmanifest.jsonXMLFragment