vendredi 9 juin 2017

Many entities in single table and repository pattern

In my database I store a media, eg. movies, series (seasons, episodes), music (groups, albums, tracks). All this data is stored in single table (Media). Question: how should I work with this table in my code? I have two options:

  1. Create single repository and one large model for all media types.
  2. Create model and repository for each media type.

Which is better and why?

Aucun commentaire:

Enregistrer un commentaire