Mukesh-
a newly married guy meets his friend Mithun - a geek software
developer, after a long time in a restaurant. In the middle of the
conversation, Mukesh expresses his concern about the daily fight between
his wife and mother.
“It’s hard to find a day without arguments and fight between them. Even simple things would trigger the fight. “Said Mukesh sadly.
Mithun : No
worries buddy. I’ll try to help you even though I never faced this kind
of problems. There is something called design patterns in software
architecture. It has solutions for any and every problem in the world.
Mukesh : Oh God! Why did I tell my problem to this crazy fellow that eats software and sleeps with software non-senses. (says to himself)
Mithun : Give me a day, Mukesh ! …a single day is enough. I’ll go through all the patterns and find a solution for you.
Mukesh : Hey, It’s ok. I know you are very busy these days. I’ll try to resolve that on my own. Thanks for willing to help me.
The very next day Mukesh gets a call from Mithun.
Mukesh : (mind voice) He must have found some crazy solution for my problem. Anyway, let’s listen what he says.
Mukesh picks up the phone. Mithun speaks on the other end in a glad tone.
“Hey buddy! I found a solution for your issue. You will find it as an apt approach”
Mukesh : What is that?
Mithun : There is a pattern called “Broker pattern” in software architecture. That means
“A
broker component is responsible for coordinating communication, such as
forwarding requests, as well as for transmitting results and
exceptions.”
You
could use that pattern in your case. I understand that the
incompatibility between mother and wife interfaces causes the problem
and there seems to be lot of misinterpretations of messages happen.
Invoking a broker will definitely make a difference.
Broker needs do the following things.
- Make sure that no direct communication happens between mother and wife interfaces at least for the conflicting concerns.
- Forward the requests and pass the results back.
- Interpret the messages that passed in an appropriate and advantageous way.
- Sometimes broker may need to modify the messages/results before pass it to the receiver.
- Exceptions
and security concerns should be handled very well and in case of
exceptions acceptable messages should be passed to the receiver rather
than directly throwing the exception message.
And you may wonder where to find the broker for you. I know the most suitable broker in your case is
“YOU”.
Mukesh agrees to try this solution.
After a week…
Mukesh calls Mithun…..
Mukesh : Buddy!
It is amazing. You gave me the best solution. By the way, where can I
buy the “software design patterns” book that you referred?