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

  • Home
  • SEARCH
  • 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 160853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:06:31+00:00 2026-05-11T11:06:31+00:00

Performance and Design wise what would be the pros and cons Using a sealed

  • 0

Performance and Design wise what would be the pros and cons

Using a sealed class and events or using a abstract class with a virtual function?

there will only be one listener to the events…

  • 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. 2026-05-11T11:06:32+00:00Added an answer on May 11, 2026 at 11:06 am

    You shouldn’t worry too much about performance in terms of abstract classes, inheritance, and event subscription. These are language constructs designed to make development & maintenance simpler. They aren’t really designed with performance completely in mind.

    There are better things to worry about when it comes to performance. A few things come to mind:

    • Boxing & unboxing – Try to avoid boxing & unboxing objects too much if you’re doing a lot of repetitive or iterative tasks.
    • Reference Types vs. Value Types – Objects created as ‘structs’ are stored by value. This means that the entire value of the object is passed around when sent in memory. This can be more expensive, but its lifetime is more deterministic, so it has an advantage in only existing within certain scopes usually. Objects created as ‘classes’ are stored by reference. When sending a by reference object around through code, you only send the reference to the object, which means less memory to move around. The downside is that because it is allocated to the heap, it’s lifespan in memory is less deterministic.
    • Subscribing/unsubscribing to events – This is not so much a performance issue as just a general development mistake. Objects will not be GC’ed unless all events are unsubscribed from. If you keep subscriptions open, your object can remain in memory forever causing a memory leak. Microsoft has good documentation on a WeakEvent pattern to help work around this problem.

    You should also read Microsoft’s MSDN documentation on Performance. It’s a pretty good reference for understanding the real performance killers in .NET. Sealed & abstract classes and event handlers are usually not a performance concern.

    Generally, code structure is more important to worry about. Think about how you’re working with your data and what patterns you use that could be heavy to execute.

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer At what point does the extender provider (IExtenderProvider) extend the… May 11, 2026 at 9:52 pm
  • Editorial Team
    Editorial Team added an answer found the answer on this question: How do I get… May 11, 2026 at 9:52 pm
  • Editorial Team
    Editorial Team added an answer This is not explorer specific, this is NTFS-related. See http://support.microsoft.com/kb/299648… May 11, 2026 at 9:52 pm

Related Questions

In cases where you have a function that works for many different custom types
I would like to normalize data in a DataTable insertRows without a key. To
Say I want to design a database for a community site with blogs, photos,
I'm working on an instant messenger client in C++ (Win32) and I'm experimenting with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.