The situation is this: You have two classes that both implement the same interface and both classes work together to complete some business process.
For example networkUserManager
and localUserManager
implement IUserManager
which has a method getUser()
. networkUserManager.getUser()
puts a request to get a User
on the queue and returns the reply. localUserManager.getUser()
gets a request off the queue, finds the user information in some database, and then replies with the user data.
When I saw something similar to this being done, I couldn't help but wonder if this was bad design. Is this bad design and if not what is an example where doing something like this would be a good idea?