An open API service indexing awesome lists of open source software.

https://github.com/shaikrasheed99/observer-pattern

Implementation of Observer Pattern.
https://github.com/shaikrasheed99/observer-pattern

design-patterns java observer-pattern tdd tdd-java

Last synced: about 2 months ago
JSON representation

Implementation of Observer Pattern.

Awesome Lists containing this project

README

        

# Observer Pattern examples using Test Driven Development

## Example-1 (NewsLetter):

* There is a newsletter publisher, who has one to many relationships with readers.
* Whenever a new arrival of news has happened, then the publisher will send notification to all kinds of subscribers of it.
* Subscribers can freely subscribe or unsubscribe from the newsletter.


### code: [NewsLetter](https://github.com/shaikrasheed99/observer-pattern/tree/master/src/main/java/com/tw)


## Example-2 (Youtube channel):

* The YouTube channel publisher will send notification to its subscribers whenever a new video is uploaded.
* Subscribers can freely subscribe or unsubscribe from the channel.


### code: [Youtube channel](https://github.com/shaikrasheed99/observer-pattern/tree/master/src/main/java/com/tw)


## Class Diagram of both examples:


![](class-diagrams/observer-pattern.png)