mardi 7 novembre 2017

What are the SRPs of a simple typical blog-like CRUD application?

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:

  1. Add a blog entry
  2. Delete a blog entry
  3. Show a particular blog entry
  4. 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.

  1. To add you need nothing in particular
  2. to view, delete, update, you need to know the id of 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