android10 / android10/Android-CleanArchitecture

How to load domain entities ?

Aperta
#119 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
Java
Stelle
15.5k
Fork
3.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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 ?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Non sono indicati file, test o punti di ingresso. Inizia leggendo l’architettura del repository e i relativi livelli di caricamento dei dati, quindi chiarisci il confine previsto dell’entità e il comportamento di caricamento; il lavoro sarebbe completato quando fosse disponibile un approccio concordato e implementabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, java
Ambito
databases, mobile-dev
Tipo di issue
Documentazione
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.