https://github.com/apigear-io/objectapi-demos
A set of demos in different languages
https://github.com/apigear-io/objectapi-demos
Last synced: 4 months ago
JSON representation
A set of demos in different languages
- Host: GitHub
- URL: https://github.com/apigear-io/objectapi-demos
- Owner: apigear-io
- Created: 2020-09-09T15:37:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T09:16:56.000Z (over 2 years ago)
- Last Synced: 2025-01-18T11:27:06.476Z (5 months ago)
- Language: C++
- Size: 63.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ObjectAPI Demos
A set of demos in different languages
# Basic Setup
Each demo contains an `apis` folder which contains the ObjectAPI definition. From this API definition solution for the different target languages are created.
Each language contains a `ini` (initial code) and a `sol` (solution code). It is easy to compare these folders.
## Calculator Demo
The calculator demo shows a simple calculator defined in a single ObjectAPI module.
The calculator has a `total` state which is automatically updated and propagated using the calculator operations.* [API](calc/apis/calculator.oapi.yaml)
* [Initial C++ 14](calc/cpp14/ini/)
* [Solution C++ 14](calc/cpp14/sol)
* [Service implementation for calculator API](calc/cpp14/sol/apigear_calc/calculator.cpp)For other languages see the respective sub-folders.
## Dice Demo
The dice demo show how one interface (`Dice`) can depend on another interface (`Random`).
The story is a device manufacturer develops an electronic dice for the gaming industry.
The dice contains a HW random component, to make it secure. How can we now develop the dice effectively without depending on the HW?* [API](dice/apis/calculator.oapi.yaml)
* [Initial C++ 14 Code](dice/cpp14/ini/)
* [Solution C++ 14 Code](dice/cpp14/sol)
* [Service implementation for dice API](dice/cpp14/sol/apigear_game/dice.cpp)
* [Service implementation for random API](dice/cpp14/sol/apigear_game/random.cpp)For other languages see the respective sub-folders.
## Future
* Demonstrate adapters for transports
* Demonstrate dynamic simulations