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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:04:34+00:00 2026-05-18T09:04:34+00:00

What are the advantages/disadvantages to each method? I know I’ve read somewhere in either

  • 0

What are the advantages/disadvantages to each method?

I know I’ve read somewhere in either a book or on this site why using table inheritance is crappy for Entity Framework 4.

For instance, why not make one table which has an entityId, datecreated, datemodified and then have every other class inherit that in entity framework? Then my tables for all other entities don’t need to have those columns. Then I can have a person class inherit that base class, and then a specific person inherit person.

I am not sure of the advantages of this though other than writing a smaller SQL script to generate the database…

Disadvantages I see are that it makes querying /viewing the data directly in SQL a big pain in the ass (all relevant information is broken across so many tables), and I also asked my friend who said:

“The biggest thing that sticks out for me is the fact that i wouldn’t want my database to rely on the current inheritance structure of my application. if, for whatever reason, i wanted to change the design of my application in terms of inheritance, it wouldn’t matter because my data wouldn’t be reliant on my current system design. i think of data storage as just that–storage. the database is normalized according to proper database design, but inheritance is a programatic choice of application development, not data storage. that alone would prevent me from using it. inheritance is a very difficult thing to do properly when it comes to designing an application. it’s much easier to change application code than it is to change and migrate database data
when most less-seasoned devs approach a problem they approach it with inheritance. i did too when i first started developing. it logically makes sense. however once developing for a long time you learn that delegation is really the best way to go (services calling services in the case of soa) and that single-purpose services provide a lot more reuse than inheritance.”

Which also makes sense to me.

So

1) In general, what are the pros/cons of inheritance vs extending
2) In my specific example above, what would be more appropriate?
3) If my example is crappy for either or both, what is a good example for using inheritance and for using extending?

I’ve used both before but as I am far from seasoned, I am still unsure how to handle all situations.

10 Votes, 8 favorited, over a hundred views and no one can expand? =(.

  • 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-18T09:04:35+00:00Added an answer on May 18, 2026 at 9:04 am

    I have tried similar thing as you describe, and the main problem I see, is that u can’t create ObjectSet<T> for derived type. So you will not have ObjectSet<Person> repository.
    If you derive all your Entities from for example BusinessObject entity, you will be able to work only with ObjectSet<BusinessObject>. If you want to query only Person repository, you can write query like Context.BusinessObjectSet.OfType<Person>().ToList() but i think it will not generate proper SQL under the hood and will first get full BusinessObject rows and then filter out Person entities in memory. So I guess it will have huge performance impact.

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

Sidebar

Related Questions

What is the advantages/disadvantages of using inline functions in C++? I see that it
What are the advantages and disadvantages of making a self-referencing table column a foreign
Please give me the advantages and disadvantages of using the particular framework. Can give
What are the advantages/disadvantages of keeping SQL in your C# source code or in
What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The
What semantic web frameworks are there, and what are the advantages / disadvantages of
What are the advantages and disadvantages of turning NOCOUNT off in SQL server queries?
What are the advantages and disadvantages of the Session Façade Core J2EE Pattern? What
What are the advantages and disadvantages of DTOs from a website performance perspective? (I'm
What are the advantages and disadvantages of shrinking a database? Are there any performance

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.