DB Parent and Child vs. OO Parent and Child (technology)

Source: Internet
Author: User
Introduction to the foreign key of the primary key-the parent table sub-table re-recognizing the concept of a contact information classification example: User's contact information 1 user's target object (receiver) contact Information 2 manufacturer's contact information 1 dealer's contact information 1 dealer's shop Contact Information 2 is available from the above information, the contact information requirements are divided into two categories: contact information that is in one-to-one relationship with the business entity

Introduction to the foreign key of the primary key-the parent table sub-table re-recognizing the concept of a contact information classification example: User's contact information 1 user's target object (receiver) contact Information 2 manufacturer's contact information 1 dealer's contact information 1 dealer's shop Contact Information 2 is available from the above information, the contact information requirements are divided into two categories: contact information that is in one-to-one relationship with the business entity

Introduction
Foreign key of primary key-recognition of parent table sub-table

A classification example of the concept of contact information:
• User Contact Information 1
• Contact Information of the user's target object (receiver) 2
• Manufacturer's contact information 1
• Dealer Contact Information 1
• Dealer store Contact Information 2
The above information is available, and the contact information requirements are divided into two categories:

  1. In a one-to-one relationship with the business entity, key relationships other than the contact information ID are placed in the business object. Such as user, manufacturer, and dealer information;
  2. The user, manufacturer, dealer, and other business objects need to have multiple contact information related to their business. The contact information of the user's receiver and the store of the seller.

Analysis

My contact information is my personal property. Is it my "parent "? Right?
Obviously, the concept of parent-child relationship in a relational database is different from that in OO.
Interestingly, relational databases focus on the horizontal "Relationships" between objects, with almost no vertical relationships. OO, on the contrary, inheritance polymorphism is the expression of vertical relationships. Of course, horizontal relationships can also be expressed as though they are not quite natural.
Therefore, the "Parent and Child" of a relational database is not equal to the "Parent and Child" of OO ".
The parent of a horizontal "relationship" is a more basic element. The smaller the granularity of the element, the longer the element ". The relational coefficient is one, with only the primary key;
The child of the horizontal "relationship" is a quadratic element, which contains components of the parent element. The relationship coefficient is multiple. There must be a foreign key.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.