android10 / android10/Android-CleanArchitecture

How to load domain entities ?

Abierto
#119 0 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
Java
Estrellas
15.5k
Forks
3.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi, and thank you for your blog and examples, they are very helpful.

I'm currently learning Clean Architecture, and I was thinking about domain entities, and how to load them correctly.
Let's say I want to display a list of TV shows from a database. The TVShow class will have a name, a synopsis, and a list of episodes. Each episode has a name, a length and so on. In my database, I can use identifiers to refer other tables; but fields in the domain model should be the correct class (e.g. `List`).

How should I load this object graph ? I won't create all "dependencies" because I will end up loading everything from my database, but in the same time my object may have business methods that need some of them. I thought about lazy loading, but the domain layer is Framework-Independent, so that's not an option. Last idea was not to load them, but then the object may be inconsistent.

What is the right approach to this problem ?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.