# DTO -\> Domain -\> UI Model: When Is the Mapping Worth It?

DevFeed: [DTO -\> Domain -\> UI Model: When Is the Mapping Worth It?](<https://devfeed.tech/articles/dto-domain-ui-model-when-is-the-mapping-worth-it-100952.md>)

Original publisher: [Read original article](<https://proandroiddev.com/dto-domain-ui-model-mapping-clean-architecture-2603f0010fcf?source=rss----c72404660798---4>)

Author: Ravi Rawal

Published: 2026-10-26T13:38:18Z

Content type: article

Language: en

Sources: [ProAndroidDev](<https://devfeed.tech/sources/proandroiddev-medium.md>)

Topics: [modular-monolith](<https://devfeed.tech/topics/modular-monolith.md>), [adapter pattern](<https://devfeed.tech/topics/adapter-pattern.md>), [business logic](<https://devfeed.tech/topics/business-logic.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [MVVM](<https://devfeed.tech/topics/mvvm.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [clean-architecture](<https://devfeed.tech/tags/clean-architecture.md>), [coupling](<https://devfeed.tech/tags/coupling.md>), [domain](<https://devfeed.tech/tags/domain.md>), [external](<https://devfeed.tech/tags/external.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [model](<https://devfeed.tech/tags/model.md>), [models](<https://devfeed.tech/tags/models.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

DTO -> Domain -> UI mappings are useful when they protect distinct responsibilities, but three models are not required by default. The article's product example separates an API-shaped DTO from a domain Product that interprets fields such as price, seller type, and status, then from a ProductCardUiModel that adds formatted price, localized labels, and favorite state. Mapping can validate or reject incomplete records, represent unknown values, and keep backend changes from spreading into business logic or presentation. A ViewModel can combine product and favorite data into card models and expose screen loading, content, or error state separately; Composables render that state. Keep a boundary when the next layer has different needs, rules, or likely reasons to change. For a small feature with a stable API, simple UI, and no meaningful domain behavior, fewer models may avoid duplicated declarations and mapping omissions. Android guidance cited in the article allows separate models for complex apps and treats the domain layer as optional. Use simple explicit mappers where sufficient; extract dedicated ones when rules, reuse, or independent testing justify them.

## Source excerpt

Three models, two mapping steps, and one simple question: are we protecting architectural boundaries or just creating more code to maintain? Open a mobile application built with Clean Architecture, and you will probably find some variation of this flow: ProductDto -> Product -> ProductUiModel The API response becomes a DTO. The DTO becomes a domain model. The domain model becomes a UI model. Each transformation has its own mapper, and each model lives in its own package or module. It looks clean. It follows familiar architectural conventions. It can also produce a surprising amount of code for displaying a product on a screen. And that raises a question worth discussing: does every layer need its own model, or have we turned a useful architectural technique into a rule that we follow without questioning? I have seen both sides of this design make sense. Sharing a network DTO throughout an application can create coupling that becomes expensive later. Introducing multiple models that contain the same properties, however, can create maintenance work without delivering much protection. The interesting part is knowing the difference. Let's follow one feature -- a product listing -- from the API response to the screen and examine what each model should contribute, where the transformations belong, and when we can reasonably skip them. Start with the API contract Imagine a marketplace application that fetches a list of products from a backend. The response for each listing looks something like this: https://medium.com/media/02059b91befe4e6cc4715d4de56bc69b/href The networking layer needs a model capable of representing this response. In Kotlin, it might look like this: https://medium.com/media/7cea74b0c4f9a5ff5de917c0b67df314/href The nullable properties are intentional. They acknowledge that the response may contain missing values, even when the backend's ideal contract says otherwise. The DTO represents an external contract. Its field names, serialization annotations, and da