vendredi 16 février 2018

How to write a 2 way Observable Pattern in C#

I need to setup something like an observable where the subscribers of the observable return a success/fail message to the parent.

I can have a bunch of different subscribers and observable actions, so I think setup interfaces for everything could get messy.

Are there any existing patterns or libraries that can handle this?

For example

Lets say I have a Car class and a Ford class. I want the Ford class to subscribe to the create event in all Car classes that have a manufacturer of Ford. If the validations inside the ford class fail, I want them to pass it back to the Car class so it can communicate the failure and rollback the create operation.

Aucun commentaire:

Enregistrer un commentaire