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 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

Related Questions

In my class design, I use abstract classes and virtual functions extensively. I had
For you database design/performance gurus out there. If you have a database that is
For you database design/performance gurus out there. I'm designing a table, I have the
We are about to design a site for rentacar reservations using asp.net. There is
Is there some idiomatic, performance or design philosophy reason why C#'s LinkedList's RemoveFirst() and
What is the best friend-list table design (for performance)? Probably there should not be
<System.Diagnostics.CodeAnalysis.SuppressMessage(Microsoft.Design, CA1045:DoNotPassTypesByReference, Justification:=Needs function to return two values.)> _ <System.Diagnostics.CodeAnalysis.SuppressMessage(Microsoft.Performance, CA1822:MarkMembersAsStatic, Justification:=Needs function to
I am looking for some design best practice or heuristic to address performance issues
Please note this question related to performance only. Lets skip design guidelines, philosophy, compatibility,
performance ? architecture ? the system in question will always be a MS SQL

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.