开发者

Abstract name for one side of a Friend/Follow relationship

开发者 https://www.devze.com 2023-03-29 21:32 出处:网络
I have a model where a User represents the user using the application and each User has friends and followers (identical to twitter relationship paradigm) which are just references to other \'User\'s

I have a model where a User represents the user using the application and each User has friends and followers (identical to twitter relationship paradigm) which are just references to other 'User's with information like dateAdded, userId etc

I've found my friend and follower model classes have similar enough high level concepts to justify an abstract base, but I can't think of a name for one side of a friend relationship that is开发者_Go百科 specific to this friend model and isn't too general.

So far my best candidate I am considering is SocialGraphVertex. Perhaps SocialGraphLeaf is more accurate or RelationshipLeaf is less of a mouthful. Any suggestions?


It's an edge in a graph, RelationshipEdge is accurate.


I would go with something like RelatedPerson.

The key concern when introducing names for such base classes is that whatever name you choose must be compliant with the is-a relations you introduce. For instance, the RelatedPerson sort of works out sense a friend is a RelatedPerson and a follower is a RelatedPerson.

It would be easier to give a good suggestion if you included a few properties of the base class.

0

精彩评论

暂无评论...
验证码 换一张
取 消