Menu

1 / 3

FLIP: Modular Architecture for KMP

DEV Community·Alexander·6 months ago
#fHXZGpSM
Reading 0:00
15s threshold

While building haskcore - an IDE for Haskell on Compose Desktop - I extracted rules that allowed me to create an architecture of 40 isolated modules, where each module knows only what it needs.

That's how FLIP - Feature-Layered Isolated Platform - was born.

The main problem I faced during development: horizontal dependencies make the system fragile . The solution - strict vertical hierarchy.

FLIP consists of the following isolated modules:

:common:core - common logic components.

:common:presentation - common UI components.

:service - UI-less domain module. Provides a service interface.

interface SeedService : AutoCloseable { val seed : Flow < Seed >

suspend fun generateSeed (): Either < Throwable , Unit > }

Enter fullscreen mode

Exit fullscreen mode

:feature:core — logic module of a UI-feature. Knows nothing about other features. Uses services from :service . Provides use cases.

class GenerateRemoteRandomSeed ( private val seedService : SeedService ) : UseCase .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.