mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #540] Terminal UI project architecture - where do you handle UI logic? Tests? #392
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @buzzdan on GitHub (Dec 21, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/540
Hi,
as a TUI newbie im still looking for best practices for my project architecture.
Is it common to organise code with MVC / MVP / MVVM / Redux or any other UI architecture out there?
how do you write tests for TUI projects?
i start to have lots of UI logic code and i find myself testing everything manually for each change...
any ideas + references would be highly appreciated 🙏
@rivo commented on GitHub (Jan 11, 2021):
I'm not sure if there is anything special about TUIs regarding the organization of code. I would certainly separate the model from everything else. But the rest — at least when using
tview— will depend on how much extra work you're willing to do to introduce more separation.tviewdoesn't separate "view" from "controller", for example, so if you want that, you're going to have to roll your own.I think how you approach this will also depend on a few other factors:
To be honest,
tviewwas built to get people started quickly on terminal user interfaces and not so much on facilitating huge projects. It doesn't mean that that is impossible but if that is your plan I would certainly suggest exploring your different abstraction options before getting started.Maybe someone else can weigh in here, too.