Desktop Architecture
- Separate UI rendering from business logic using MVP, MVVM, or MVC patterns — never put domain logic in event handlers.
- Keep the main/UI thread free of blocking operations — offload file I/O, network calls, and heavy computation to background threads.
- Use a single source of truth for application state with unidirectional data flow to prevent state desynchronization across windows.
Desktop Architecture
- Separate UI rendering from business logic using MVP, MVVM, or MVC — never embed domain logic in event handlers or widget callbacks.
- Keep the main/UI thread responsive: offload file I/O, network calls, and heavy computation to background threads or worker processes.
- Use a single source of truth for application state with unidirectional data flow to prevent state desynchronization across windows and dialogs.
- Implement a platform abstraction layer so core business logic is testable without a running GUI framework.
- Handle window lifecycle events (close, minimize, focus) explicitly — persist unsaved state, confirm destructive operations, and manage resource cleanup.
- Use native OS conventions for menus, keyboard shortcuts, drag-and-drop, and accessibility — don't reinvent platform-standard interactions.
- Design for offline-first: cache data locally (SQLite, embedded DB) and sync with remote services when connectivity is available.