The KOS UI SDK is intended for use by front-end developers building user interfaces for KOS-based dispensers. This includes both Consumer User Interfaces (CUI) and the Non-Consumer User Interfaces (NCUI). The SDK allows for more natural idiomatic React development practices that insulate front-end teams from some of the complexities inherent in working with hardware-based embedded systems.
React front-end development has, traditionally, been focused on REST-based client/server architectures.
For front-end developers and teams more accustomed to building cloud-based enterprise applications, there will be some concepts in KOS that are more familiar when working with dispensers including asynchronous messaging and event-based near-real-time notifications.
KOS front-end development is, architecturally speaking, conceptually more aligned with building UIs for microservices and/or event-sourced systems. When dealing with data, the dispenser hardware and physical components represent the source of truth. The data models used by the KOS UI framework present a materialized view of the physical data that is updated based on events sent over a WebSocket transport.
The KOS UI SDK provides an abstraction that allows dispenser front-end development to feel more like traditional React development rather than having to incorporate complex asynchronous interactions into component and application code.
In traditional web development, most interactions are of the request/response variety with a typical lifecycle consisting of a user navigating to a page, the required data is loaded based on a full fetch of the data model from a REST API. Updates to the data are performed when the user returns to the page or explicitly refreshes the page. In many cases, edit operations receive all (or a significant amount), of the data model to be returned and incorporated into the page model.
This model doesn’t apply in KOS as almost every interaction on the dispenser is long-running and asynchronous. The KOS platform provides abstractions that make managing the complexity easier.
Made up of a few major components:
KOS Model Framework
Provides an entity model and state management framework that is tuned to the behaviors and lifecycles associated with KOS-based dispensers.
KOS React Components and Hooks
A set of React hooks and utilities that enable the consumption of KOS Models and concepts in a form that will be more familiar to developers used to working with React on more traditional web-based projects.