Invoicing design-data table structure design of documents

Source: Internet
Author: User

Document data table Design

 

In table design, I tried two methods:
Use the same entity to represent the sales and purchase orders and other documents, and then identify them by the Document Type field. Because the document is designed to access and exit goods, the document type must have a status sign. The reason for doing so is:
1. In line with the OO design philosophy, the order is regarded as a class
2. Good code reusability and High Efficiency
3. It is conducive to business expansion. by inheriting the order class, you can add new businesses by adding interface methods.
In the implementation process, especially in the database design, this idea produces some small tables

 

Of course, you can also split a ticket, that is, consider each ticket as a separate entity. This has the following benefits:
1. For enterprises with large business volumes, splitting orders helps reduce the complexity of data query;
2. When implemented by programmers, the coding complexity is reduced and the code readability is also good;
3. The set of books is more flexible in business data backup and can be separately backed up for different businesses;
However, the design abstraction level is low, and the code reuse efficiency is not high.

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.