Say I have a data that all relates to an entity. I need a way to create, read, update, and delete data for/to/from a storage of that entity.
For example, we can use a Blog entity. Actions could be:
- Add a blog entry
- Delete a blog entry
- Show a particular blog entry
- Update a blog entry
All actions relate to a single entity of Blog. Does that mean all CRUD falls within the same SRP?
Each action may need slightly different data.
- To add you need nothing in particular
- to view, delete, update, you need to know the
idof blog entry
Does that mean we have two SRPs here, one that needs id and one that does not?
If I was a Writer in charge of the blog I could say my responsibility is to create, write the blog entries, but to show them maybe someone else's responsibility, such as that of a Publisher. And to delete, and update may be a responsibility of an Editor. Does that mean we have three SRPs here?
I am a tad confused, can I have clarification?
Aucun commentaire:
Enregistrer un commentaire