Observer Pattern in C#
- Description: The code below simulates how you get notifications from celebrities you follow on Facebook using the Observer in C#.
- Input: None
- Output:
--> System notification: 1 person just follow you!. You have: 1 follower
Hello Follower 1! You have a message from your crush: I'm hungry
--> System notification: 1 person just follow you!. You have: 2 follower
Hello Follower 1! You have a message from your crush: I'm boring
Hello Follower 2! You have a message from your crush: I'm boring
--> System notification: 1 person just follow you!. You have: 3 follower
Hello Follower 1! You have a message from your crush: I have a boyfriend
Hello Follower 2! You have a message from your crush: I have a boyfriend
Hello Follower 3! You have a message from your crush: I have a boyfriend
--> System notification: 1 person just UN-follow you!. You have: 2 follower
Hello Follower 1! You have a message from your crush: I will go to Vietnam
Hello Follower 3! You have a message from your crush: I will go to Vietnam
Hello Follower 1! You have a message from your crush: I I just broke up with him
Hello Follower 3! You have a message from your crush: I I just broke up with him
--> System notification: 1 person just follow you!. You have: 3 follower
Hello Follower 1! You have a message from your crush: I have been lived in here for 1 day, the best country that I know
Hello Follower 3! You have a message from your crush: I have been lived in here for 1 day, the best country that I know
Hello Follower 2! You have a message from your crush: I have been lived in here for 1 day, the best country that I know