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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:12:12+00:00 2026-05-31T16:12:12+00:00

I have custom event that has several different subscribers who will all use the

  • 0

I have custom event that has several different subscribers who will all use the data passed in my CustomEventArgs and potentially change it for their own use. What is considered the best practice in this scenario to prevent one subscriber from polluting the data that another subscriber is using? Should the publisher create clones of the data and invoke each of the subscribers’ delegates separately? Should the subscriber be responsible for cloning the data if it is to be modified?

Thanks in advance.

  • 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-31T16:12:13+00:00Added an answer on May 31, 2026 at 4:12 pm

    Typically, I would recommend making the EventArgs derived class immutable. The publisher can then set a single instance up and call all delegates normally without worry.

    Subscribers can always make their own class based on this data as needed.

    The one exception to this would be situations where you want to have some form of Handled property within the argument, in which case, you want subscribers to be able to overwrite this value. This is one case where proper documentation is typically enough to handle this correctly.

    I would rarely recommend calling subscriber delegates separately.

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

Sidebar

Related Questions

I have an application that has created a number of custom event log sources
I have custom coded several enterprise applications for mid to large organizations to use
I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)
I have a custom control that has an update panel in it. Within the
I have a custom control that has a property that is an ObservableCollection of
First a little background: I have an Event model that has various event_type s.
I have an ASP.NET web form that has a container usercontrol that hosts several
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom event handler, or I suppose some call it a custom
So I have a custom event like this: Work w = new worker() w.newStatus

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.