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 8388491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:29:00+00:00 2026-06-09T18:29:00+00:00

In my application, I have a scenario where if a change occurs on a

  • 0

In my application, I have a scenario where if a change occurs on a particular module, it has to be notified to few other modules. I thought an observer pattern would fit here, by keeping the module on which the change will occur as subject and the modules to be notified as observers.

But going by the principle of observer pattern, the observers are independent of each other. There should be no connection between the observers. In my case, though the modules are different, they are dependent. The successful completion of execution of the first module is important for the next module to execute. Also if the module x fails, all changes made by module 1 to module x-1 has to be reverted. That is, either all the modules has to successfully execute or we have to rollback to previous state. You can imagine it like a transaction. Then I realized I was wrong that observer pattern is not the right way to implement this.

I am kind of stuck up here to come up with a clean design, where there are set of modules who needs to handled when a change in subject happens, but with the constraint the modules are dependent on each other. Can someone help me with this problem to come up with a good design?

  • 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-06-09T18:29:01+00:00Added an answer on June 9, 2026 at 6:29 pm

    You can still use the observer pattern: All you need to do is change the way the event travels across the observers.

    In the original design, module X raised and event to module A, B and C. But the problem is that C depends on B, and since you don’t control the order (and don’t want to) of execution of the observers, you have a problem. I would suggest you simply make C and observer of B, instead of an observer on A!

    This way, when A raises the event, it will propagate in the desired order. A -> B -> C.

    That being said, I wonder whether you really require this level of decoupling. Basically you are describing here a standard flow of information and unless the modules are very reusable, you can make the calls explicitly. A directly calls B, which directly calls C.

    Transactions are an orthogonal concern to data propagation. I am afraid you will have to treat them separately. If you elaborate about the state transitions that potentially need to be rolled back, the community may try to help there too.

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

Sidebar

Related Questions

Scenario I have a C# windows forms application that has a number of processes.
Scenario: I have a console application that needs to access a network share with
The Scenario I have a windows forms application containing a MAINFORM with a listbox
Scenario I have a Windows Forms Application. Inside the main form there is a
Scenario I have a windows forms application. I want to use two different WCF
Scenario I have a background worker in my application that runs off and does
I have the following scenario.The implementation is required for a real time application. 1)I
I have the following scenario. I have created an ASP.NET web application (framework 3.5)
I have the following scenario: - 64bit Windows Server 2008. - 32bit .NET application
Let me share the following scenario: I have a ASP.NET intranet Web-based application that

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.