Appearance
Data Transformer
Design Philosophy
API responses often require reformatting to meet UI requirements, which is why we implement view models.
Data transformers were introduced to implement the DTO design pattern (DTO Pattern), creating a clear separation between backend data models and frontend view models. These transformed data structures are known as Data Transfer Objects (DTOs). As noted in Wikipedia, view models themselves can be considered DTOs.
Usage Scope
Contains all data transformation functions, organized by entity. For instance, both article and pushArticle are grouped within the ArticleDataTransformer class in article.ts, following this pattern for other entities.