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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:07:13+00:00 2026-05-12T05:07:13+00:00

In trying to understand the correlation between program objects and data in tables (here:

  • 0

In trying to understand the correlation between program objects and data in tables (here:OO program and SQL database), which I still don’t really understand, a strong difference of opinion was revealed over whether it’s ok to use a SQL db to store data for an OO program.

  1. For a new programmer, is it ok/recommended, or not?

  2. If not, is the alternative to an OO program a procedural program?

Also I don’t understand Object-relational impedance mismatch, which is what people mean when they say that it’s “not OK to use an SQL DB to store data for an OO program”: can someone summarize it, or is there a simple example that illustrates it?

  • 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-12T05:07:13+00:00Added an answer on May 12, 2026 at 5:07 am

    For a new programmer, is it ok/recommended, or not?

    That question implies that the system design/components/architecture are chosen/intended to benefit the programmer.

    Instead I prefer to choose the design/components/architecture to benefit the system (and the system’s owners, users, and operators), and ensure that the programmers know (which may require some learning or training on their part) what they need in order to develop that system.

    The facts are:

    • OO is often a good way to develop software
    • SQL DBs are often a good way to store data
    • Designing the mapping from SQL to OO may be non-trivial

    If not, is the alternative to an OO program a procedural program?

    Well, maybe, yes: one of the features of OO is subclassing, and subclasses/inheritance is one of the things that’s problematic to model/store in a SQL database.

    For example, given a OOD like this …

    class Animal
    {
      int id;
      string name;
      abstract void eat();
      abstract void breed();
    }
    
    class Dog : Animal
    {
      bool pedigree;
      override void eat() {...}
      override void breed() {...}
    }
    
    class Bird : Animal
    {
      bool carnivore;
      int numberOfEggs;
      void fly() {...}
      override void eat() {...}
      override void breed() {...}
    }
    

    … it isn’t obvious whether to store this data using 2 SQL tables, or 3. Whereas if you take the subclassing away:

    class Dog
    {
      int id;
      string name;
      bool pedigree;
      void eat() {...}
      void breed() {...}
    }
    
    class Bird
    {
      int id;
      string name;
      bool carnivore;
      int numberOfEggs;
    
      void fly() {...}
      void eat() {...}
      void breed() {...}
    }
    

    … then it’s easier/more obvious/more 1-to-1/more accurate to model this data using exactly two tables.

    Also I don’t understand Object-relational impedance mismatch

    Here’s an article that’s longer and more famous than the Wikipedia article; maybe it’s easier to understand: The Vietnam of Computer Science

    Note that one of the solutions, which is proposes to the problem, is:

    “Manual mapping. Developers simply
    accept that it’s not such a hard
    problem to solve manually after all,
    and write straight relational-access
    code to return relations to the
    language, access the tuples, and
    populate objects as necessary.”

    In other words, it’s not such a hard problem in practice. It’s a hard problem in theory, i.e. it’s hard to write a tool which creates the mapping automatically and without your having to think about it; but that’s true of many aspects of programming, not only this one.

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

Sidebar

Ask A Question

Stats

  • Questions 159k
  • Answers 159k
  • 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 .min [5, 10].min .max [4, 7].max They come from the… May 12, 2026 at 11:28 am
  • Editorial Team
    Editorial Team added an answer They certainly survive to Gen 1 since they are placed… May 12, 2026 at 11:28 am
  • Editorial Team
    Editorial Team added an answer I cannot use a database to hold these values because… May 12, 2026 at 11:28 am

Related Questions

I am trying to get a feel for the difference between the various classes
We recently bought a new rack and set of servers for it, we want
I am trying to learn more about regular expressions I have one below that
I'm trying to solve the problem here but I don't know why my code
is using empty working set or forcing GC collects a recommended practices in trying

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.