Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3936448
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:56:56+00:00 2026-05-19T23:56:56+00:00

I know what is usual mediator design pattern (some description is in wikipedia: http://en.wikipedia.org/wiki/Mediator_pattern

  • 0

I know what is “usual” mediator design pattern (some description is in wikipedia: http://en.wikipedia.org/wiki/Mediator_pattern). In my SOA I have Notification Service: he should broadcast messages from one service to all other that are subscribed for this particular service. Actually, any service can be a source of such messaging.

My vision of such service implementation causes circular dependency between services. Here (Circular dependency in SOA)
I’ve asked how to resolve it and received advice to use ‘Mediator’ pattern for this purpose.

If I correctly understand, my Notification Service should have a contract:

interface IMediator
{
    void PublishMessage(IMessage message);
}

Service should implement (host) this interface and expose it as service outside.

Any subscriber should:

  1. Implement (host) the same interface on own side;
  2. Be registered on the Notification Service side.

Actually subscribers can use interface with another meaning, for example:

interface IReceiver
{
    void ProcessMessage(IMessage message);
}

In this case I see the following communications flow:

  1. Any service will call IMediator.PublishMessage(message) of the Notification service;
  2. Notification Service will go through the list of subscribers and will call IReceiver.ProcessMessage(message) for each subscriber.

Question 1: is everything fine with such design?

Question 2: what should be a type of IMessage?

For now I need to pass simple string, so one of the possible implementation could be the following:

interface IMessage
{
    string MessageType{get;}
    string MessageContent{get;}
}

But here I see 2 concerns:

  1. I don’t think that passing MessageType as a string is a good idea;
  2. I don’t like to encode any type of messages into string….

Please advise. Any thoughts are welcome!

P.S. I plan to use WCF service as a base engine for services.

EDITED: after some thinking I see that:

  1. a separate method in IMediator is required per each message type;
  2. a separate Receiver interface is required for each message type.

From one side – seems reasonable, from another – big overhead…

?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:56:57+00:00Added an answer on May 19, 2026 at 11:56 pm

    Restating what you just mentioned above, the central idea of the mediator pattern is to remove the coupling between objects.
    One of the reasons for this is to encapsulate the complexity of interacting with an object by limiting it to a class instead of spreading it around the entire program.
    IMHO the class is meant for delegation.

    The publish-subscribe problem that you talk about here is more the realm of the Observer pattern – http://en.wikipedia.org/wiki/Observer_pattern

    This is described well here : http://en.wikipedia.org/wiki/Event-driven_SOA
    This article also addresses the issues of the data structure for the message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

IE6+ got some problems with transition as usual but i know ways to get
I'm quite confused about some terms, I know Java for writting some usual executable
We all know the usual use of templates to design containers and we all
I know this is largely an opinion, but I'm interested if you have one
I know its not the usual thing to do. But the specification I'm implementing
Currently I have the usual Controller/Action structure: BlogController: /blog/list /blog/create /blog/detail/my-blog-hash And PostController /post/create
I know this is a usual problem, but I haven't seen any solution to
I know, the question may be a usual for many, but I am confused
I know this is a fairly notorious topic, but none of the usual solutions
Does anybody know how to update RubyGems on Ubuntu. The usual way doesn't work:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.