c# - Is the Observer Pattern applicable when Subject and Observer need to be in separate assemblies? -
c# - Is the Observer Pattern applicable when Subject and Observer need to be in separate assemblies? -
i have seen multiple examples of observer pattern subject , observer in same assembly. seems me more 'real world' illustration have subject , observer(s) in separate assemblies on different machines communicating across network or internet. observer pattern applicable in situation or there else should looking at?
"separate assemblies" implementation detail. implementation details not matter when deciding whether pattern applies.
you can absolutely apply observer pattern across assembly boundaries, or across physical boundaries.
you can consider publish/subscribe pattern or mediator pattern alternatives.
c# observer-pattern
Comments
Post a Comment