I have a class as follows
class Controller {
Stream<Requests> stream;
}
and other listener classes that want to know about requests from the stream and act according to them.
I wanted to know what is better in terms of OO principles:
- exposing the stream and letting listener classes listen to it
- Adding listener classes as observers and notifying them when a new request arises from the stream?
- maybe a different solution that i didn't mention here?
I don't think it matters but I am using dart, question probably applies to any oo language.
Aucun commentaire:
Enregistrer un commentaire