AI Briefing
KO

Improving Code Quality - Session 63: The Betrayal of Values

·2026.01.23 12:00

Key point

Including collection index information in a data model causes data inconsistency during filtering, so such data should only be generated when needed, such as at the UI layer.

Details

If the data model Article includes index information such as pageNumber, values change discontinuously when filtering or sorting the data. This is a data inconsistency phenomenon that occurs because an index is a property of the Collection itself, not of an individual element.

To prevent the risk of data inconsistency, information that depends on the collection, such as an index, should be generated right before use in a UI data model (e.g., ArticleUiState) rather than in the domain model.

When data duplication is unavoidable, the following points should be kept in mind.

  • Clearly define the Primary data
  • Generate the data right before it is used

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.