Number of likes for particular tool

Hi, I am doing one project where owner can add software tools and user can download it. Now I am working on the “likes” part of tool so can anyone give idea about how to do the that? How to count the number of likes for that particular tool.
1 answers

Hi Sayali,

I'm gonna assume you have 2 entities in your domain model now: Tool and Account. 

Now you want to create an entity in between those two: call it LikedTool or Favourite or whatever you like to name it. It will have a many to one relation ship to both Account and Tool.

Now, if someone likes a tool, you create an object of LikedTool, associate it to the account, and associate it to the tool. 

If you then count the number of LikedTool objects for a given Tool, you have the number of likes.