Decompose

screenshot of Decompose

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing (navigation) and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.)

Overview

Decompose is an innovative Kotlin Multiplatform library designed to streamline the development process by breaking down code into tree-structured, lifecycle-aware business logic components (or BLoC). This structuring not only enhances the organization of your code but also facilitates effective routing and pluggable UI, making it compatible with frameworks like Jetpack Compose, SwiftUI, and more.

The concept behind Decompose is to promote better separation of concerns, allowing developers to create modular and reusable components. This results in cleaner code and more efficient testing processes, especially for business logic. With Decompose, developers can navigate the complexities of application architecture while maintaining clarity and control.

Features

  • Tree-Structured Components: Divides code into small, independent components organized in a tree structure, enhancing modularity and reusability.

  • Lifecycle Awareness: Each component manages its own lifecycle, ensuring proper state preservation and facilitating background operations without UI disruptions.

  • Pluggable UI Support: Supports various UI frameworks, enabling developers to use their preferred platform-specific UI components seamlessly.

  • Testable Business Logic: Promotes pure multiplatform unit tests by ensuring a clear distinction between UI and non-UI code.

  • Flexible Navigation: Enables custom navigation state management with a clear mapping from old to new states, allowing for limitless navigation possibilities.

  • Dependency Injection: Offers robust dependency injection and inversion of control through type-safe arguments, simplifying component interactions.

  • Child Stack & Panels: Facilitates complex navigation structures with child stacks for nested navigation and child panels for multi-pane layouts.