Investigates the Property DDS binding API with a slightly more complex scenario. See simple binding app for a simpler scenario.
Needed dependencies
$ node --version
v16.13.1
$ npm --version
8.1.2
Using NVM for node version management
nvm use v16.13.1cd FluidPatterns
npm run clean
npm install --legacy-peer-deps
npm run buildTerminal 1
npx tinyliciousTerminal 2
cd FluidPatterns/apps/array-property-binding
npm install -g serve
serve -s buildor
cd FluidPatterns
npm run complex-binding- React
- Hooks for UI state and state change side effects
- Fluid Framework
- Property DDS
- Data Binding to listen on data model changes
{
typeid: "hex:dice-1.0.0",
inherits: "NamedProperty",
properties: [
{ id: "diceValue", typeid: "Int32" }
],
}{
typeid: "hex:diceArray-1.0.0",
inherits: "NamedNodeProperty",
properties: [
{ id: "dices", typeid: "hex:dice-1.0.0", context: "array" },
],
}The source of truth is maintained in Fluid. The UI state is derived from the Fluid state. The data model changes are applied using a domain specific (Dice Array) API to the underlying Property DDS data model. Incremental model changes bubble up via the data binding mechanism as domain changes (Dice Array Change) and are applied to a generic (React agnostic) display. The proposed design ensures that the UI layer (React based, App.tsx at this stage) can be easily swapped with any other presentation technology.
src/
├── dice-1.0.0.ts -> Dice Template (Schema)
├── diceArray-1.0.0.ts -> Dice Array Template (Schema)
├── diceArrayApi.ts -> Dice Array API
├── diceArrayBinding.ts -> The DataBinding impl. for the Dice Array
├── diceArrayChange.ts -> Encapsulation for a Dice Array incremental change
├── diceArrayController.ts -> Dispatches incremental changes to the rendering component
└── diceArrayDisplay.ts -> Technology agnostic conceptualization for rendering aspects
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.


