https://github.com/edvin/todomvc
TodoMVC with TornadoFX
https://github.com/edvin/todomvc
Last synced: 2 months ago
JSON representation
TodoMVC with TornadoFX
- Host: GitHub
- URL: https://github.com/edvin/todomvc
- Owner: edvin
- Created: 2017-03-19T15:05:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-15T08:46:56.000Z (over 7 years ago)
- Last Synced: 2025-04-04T22:43:40.617Z (2 months ago)
- Language: Kotlin
- Size: 58.6 KB
- Stars: 50
- Watchers: 5
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TodoMVC TornadoFX
This is the TornadoFX take on the Todo MVC application.
## Description of Views
`MainView` encapsulates the `Header`, `TodoList` and `Footer` while the `TodoList` uses `TodoItemFragment` for each ListView cell.

## Filtering
The `Footer` contains three toggle buttons that allow you to select what todo items to show. The selection
represents a predicate set on a `SortedFilteredList`.## Editing todo items
We leverage the built in `ListView` editing support to toggle between a label and a textfield for the
text of the todo item. When the edit is committed, the underlying `SortedFilteredList` will update
automatically to reflect the changes. If the edited todo item no longer satisfies the current filtering
predicate, the item will no longer be visible. This all comes for free by leveraging the `SortedFilteredList`
together with the native `ListView` editing support.## Declarative programming
I opted for using builders together with declarative constructs like `removeWhen`, `toggleClass` and `whenVisible`
to configure actions and changes in UI state. This makes for source code that is easy to read and understand
as well as being a pleasure to maintain. I believe this showcases some of the greatest advantages TornadoFX
offers compared to almost every other UI framework.## Alternative approaches
I opted for a model with some coupling, by injecting the controller and calling functions instead of
using the event bus. If there is any interest I'll create an alternative implementation with events.