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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:41:27+00:00 2026-05-22T20:41:27+00:00

I am redesigning how events (related to data) are handled for existing code (in

  • 0

I am redesigning how events (related to data) are handled for existing code (in C++). The events to be handled are DataTable related events, and XmlNode related events.

I’m wanting to create a general super class with virtual functions (calling it EventManager) in order to provide consistency across the application.

I plan to have the following virtual functions in the EventManager:

DataChanged(EventArgs arg)
DataChanging(EventArgs arg)
DataInserted(EventArgs arg)
DataInserting(EventArgs arg)
DataRemoved(EventArgs arg)
DataRemoving(EventArgs arg)

I have used EventArgs as a parameter because the others (XmlNodeChangeEventArgs, DataRowChangeEventArgs, DataColumnChangeEventArgs) are derived from it. But by using it in the virtual functions, I will have lost information unique to the derived event args.

My question, how should I be designing/handling this super class and the virtual functions in order to have a general class that manages events, but can still properly map (with all information needed) to the derived classes?

I did my best to explain my situation, but please feel free to ask questions to clarify the question. I’m really looking for well thought out answers, so I’m open to improving my question!

Thank you in advance for your time and patience! 🙂

  • 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-22T20:41:27+00:00Added an answer on May 22, 2026 at 8:41 pm
    1. Pass the arguments by reference, passing by value just adds an additional overhead.

    2. But by using it in the virtual functions, I will have lost information unique to the derived event args.

    You can use dynamic_cast and check the validity of the downcast, no information will be lost.

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

Sidebar

Related Questions

I'm redesigning a class constructor in C++ and need it to catch an unspecified
I'm re-designing a Web site and I have a problem with the existing data
I am reviewing / redesigning / refactoring a database and want to create a
I'm redesigning an analog gauge widget I made a while back, essentially wanting to
I am redesigning a command line application and am looking for a way to
My company is redesigning our intranet site and decided to go with DotNetNuke as
We're in the process of redesigning the customer-facing section of our site in .NET
I've been tasked with redesigning part of a ms-sql database structure which currently involves
So, I am writing some sort of a statistics program (actually I am redesigning
I'm redesigning a web site that has a bunch of tags in the content

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.