android-clean-architecture-boilerplate icon indicating copy to clipboard operation
android-clean-architecture-boilerplate copied to clipboard

Domain Layer Mapping

Open AldrichMascarenhas opened this issue 6 years ago • 1 comments
trafficstars

The layer defines the Bufferoo class but no mapper. This is because the Domain layer is our central layer, it knows nothing of the layers outside of it so has no need to map data to any other type of model.

Is there a detailed reason why the Domain Has no Mappings? wouldn't a Bufferoo fetched from an external source need to be mapped to a Bufferoo in the domain?

AldrichMascarenhas avatar Mar 01 '19 15:03 AldrichMascarenhas

That's because Domain is the innermost layer, it shouldn't know anything about external source models. In only says 'I want to get this thing and I am going to do something with it. I don't care where it comes from, I only care that it's a Bufferoo'. The Data layer, as the outer one, knows how a Bufferoo looks, so when it gets a model from external source, it's responsible for mapping it to a Bufferoo.

qwertyfinger avatar Mar 30 '19 18:03 qwertyfinger