I am trying to develop a real-time feed, and have run into a dilemma. I have the standard event, with a user as the subject –
- Person is now action. [ For example, “John is now connected with Steve“. ]
This event occurs when a person that I am following does something.
In addition, I also have an event that is dependent on a non-user object, a “production” –
- Production is now action [ For example, Titanic now includes Kate Winslet in its credits.
In other words, users can follow other 1) users or 2) productions. However, the two events may butt into each other. Suppose the following example.
1)
- David is not following the user Steve.
- David is following the production Titanic
- Titanic has a new event, which involves the user Steve.
- Since David is following Titanic and not Steve, David;s feed will say something like:
“Titanic now includes Steve in its credits”. - Now David starts following Steve, the above grammar works but suppose this case:
2)
- David is following Steve now, but not Titanic.
- Steve joins the production Titanic. On David’s feed would say something like:
“Steve joined the production Titanic“. - Now David starts following the Titanic, the above grammar works, but is in conflict with 1) based upon the ordering of events.
It seems this is why sites like Facebook/LinkedIn always have a single consistent object as the subject of the event (a user, in their cases).
Would it be possible to have both a user and a production? I know it would be more difficult, but how could it be done?
Several ways:
Another way to think about the problem is to use role-oriented programming techniques.