<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj" -->

---
title: How Horizontal Clean Architecture Created a Room...
description: When splitting an Android project into feature modules, a dependency cycle emerged from Room&#x27;s requirement to reference entity types at compile time. The...
canonical: https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How Horizontal Clean Architecture Created a Room Dependency Problem | daily.dev
og:description: When splitting an Android project into feature modules, a dependency cycle emerged from Room&#x27;s requirement to reference entity types at compile time. The...
og:url: https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj
og:image: https://api.daily.dev/og/posts/mTLOwWNTJ.png
og:image:alt: How Horizontal Clean Architecture Created a Room Dependency Problem
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How Horizontal Clean Architecture Created a Room Dependency Problem

**[Medium](https://daily.dev/sources/medium_js)** · 9 min read · 0 upvotes · 0 comments

## Summary

When splitting an Android project into feature modules, a dependency cycle emerged from Room's requirement to reference entity types at compile time. The author's horizontal Clean Architecture (presentation/domain/data layers) didn't clearly define who owned the database schema. The solution was introducing a dedicated `local` module per feature to hold Room entities and DAOs, breaking the cycle without merging everything into a shared core-database module. Architecture tests were added to enforce the new boundaries. The post also covers why a separate Paging abstraction was collapsed back into the feature implementation since it had no real second consumer.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@nikolayv_dev/how-horizontal-clean-architecture-created-a-room-dependency-problem-60a529f417ba>

## Similar posts on daily.dev

- [Building a Modularized Android App: A Practical Guide to Clean Architecture in 2026](https://daily.dev/posts/building-a-modularized-android-app-a-practical-guide-to-clean-architecture-in-2026-kseskxqoz) · Medium · 0 upvotes · 0 comments
- [Android Modularization That Holds Up: 5 Lessons for Large Codebases](https://daily.dev/posts/android-modularization-that-holds-up-5-lessons-for-large-codebases-1tagym5g1) · ProAndroidDev · 0 upvotes · 0 comments
- [MVVM \+ Clean Architecture in Android: The Folder Structure That Scales](https://daily.dev/posts/mvvm-clean-architecture-in-android-the-folder-structure-that-scales-9nvzttmkb) · Medium · 0 upvotes · 0 comments
- [Feature Modularization in Flutter: How to Combine Clean Architecture and Domain-Driven Design for Self-Contained, Scalable Features](https://daily.dev/posts/feature-modularization-in-flutter-how-to-combine-clean-architecture-and-domain-driven-design-for-se-av2mxrlbi) · freeCodeCamp · 1 upvotes · 0 comments
- [Beyond CLEAN and MVP: Architecting an Offline-first Reactive Data Layer in Android](https://daily.dev/posts/beyond-clean-and-mvp-architecting-an-offline-first-reactive-data-layer-in-android-owjsx1xte) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#android](https://daily.dev/tags/android)

[View this post on daily.dev](https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How Horizontal Clean Architecture Created a Room Dependency Problem","url":"https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj"},"datePublished":"2026-07-23T19:21:46.011Z","dateModified":"2026-07-23T19:36:42.058Z","description":"When splitting an Android project into feature modules, a dependency cycle emerged from Room's requirement to reference entity types at compile time. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5bcd53fe98575b3e6adca58422cc77fd?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5bcd53fe98575b3e6adca58422cc77fd?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-horizontal-clean-architecture-created-a-room-dependency-problem-mtlowwntj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,android","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"How Horizontal Clean Architecture Created a Room Dependency Problem"}]}
```

