Description: Two interfaces Subject, Observer, and its correspondent concrete class ConcreteObserver that extending class Observer were created in a new separate observer.py. The Subject interface declares a set of methods for managing subscribers, including attach, detach and notify to a client object.
MSTranslator functions to translate the questions and answers in English into another language and write them in a csv file which will be observed by our Observer.
Also, observer Design Pattern follows Open-closed principle, so new subscriber objects can be easily introduced while keep publisher code unchanged. Subscriber lists can be customized freely.
Description: Two interfaces
Subject
,Observer
, and its correspondent concrete classConcreteObserver
that extending classObserver
were created in a new separateobserver.py
. TheSubject
interface declares a set of methods for managing subscribers, includingattach
,detach
andnotify
to a client object.MSTranslator
functions to translate the questions and answers in English into another language and write them in a csv file which will be observed by ourObserver
. Also, observer Design Pattern follows Open-closed principle, so new subscriber objects can be easily introduced while keep publisher code unchanged. Subscriber lists can be customized freely.