clojj / fmodel-demos

Functional Domain Modeling - Demos - https://fraktalio.com/fmodel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functional domain modeling - Examples

The word domain here means the area of interest in the business. When you are developing an information system to automate activities of that business, you’re modeling the business. The abstractions that you design, the behaviors that you implement, and the UI interactions that you build all reflect the business — together they constitute the model of the domain.

f(model)

These examples are demonstrating the usage of the fmodel library.

Library is written in Kotlin programing language by practicing functional style (Arrow). It is a small library constructed out of generic data types that can be used to effectively model any stateful information system.

It is truly decoupling the pure declaration of our program logic from the runtime. And therefore, the runtime has the chance to see the big picture of our program and decide how to run and optimize it.

Examples

To demonstrate that pure declaration of our program logic is separated from the runtime target and infrastructure, we are going to practice onion architecture / ports and adapters in all examples.

onion architecture image

The arrows in the image are showing the direction of the dependency. Notice that all dependencies point inwards, and that Domain is not depending on anybody or anything.

Restaurant management system

Restaurant management system is:

  • managing restaurant menus and other information including location and opening hours
  • managing the preparation of orders at a restaurant kitchen

restaurant management - event model

We are going to run our unique core domain logic in different ways, by implementing different application and/or persistence layers:

Type Description Technology
State stored information system Restaurant management Kotlin, Arrow, Reactive Spring Boot, R2DBC
Event-sourced information system Restaurant management Kotlin, Arrow, Reactive Spring Boot, Axon Server

References and further reading


Created with ❤️ by Fraktalio

About

Functional Domain Modeling - Demos - https://fraktalio.com/fmodel/

License:Other


Languages

Language:Kotlin 100.0%