Metadata-driven thinking instance analysis

Source: Internet
Author: User

Preface:

Take the Database Export as an Excel file as an example to analyze the abstract thinking and metadata definition and parsing and execution processes.

Problem:

In the system, various Excel export function requirements are common. How can I develop a general Excel export function? Can it meet various needs?

Exploration:

First, you need to manually write a program to export data from the database to excel. Try not to use SSH or the like.

Analysis:

The data export function is mainly divided into two processes:

(1) obtain the required dataset from the database as required;

(2) create an Excel template as required;

(3) write data into an Excel file and name the Excel file according to certain rules;

Thoughts:

List several examples of exporting Excel files. perform further analysis based on the above analysis process to extract the changed and unchanged parts. The unchanged parts are used as the general architecture, the changed part is clearly defined using data. We can see that the changes need to be defined as follows:

(1) obtain the SQL statement of the dataset and the list of fields to be returned;

(2) Field List of the Excel template;

(3) correspondence between the dataset Field List and the field list in the Excel template;

Modify the Export program so that the program can perform corresponding operations according to the content defined above to export excel. The content configured above can be stored in XML files, text files, or databases. In fact, this part of data can be called metadata;

Key points:

(1) abstract thinking;

(2) The analysis process extracts all uncontrollable parts that may change according to requirements;

(3) the changed content is the content to be configured and defined, that is, metadata. The metadata format is the metadata model;

(4) modify the program to automatically parse and adapt to metadata;

(5) consider various requirements as much as possible, improve the practicability of the format of defined metadata, and improve the applicability of general programs;

Subsequent extensions:

(1) considering supporting multiple databases, data link information needs to be configured and defined;

(2) to export Excel or text files, you must define the export mode and format;

(3) consider convenient and convenient configuration data definition and maintenance, and define the configuration data format and maintenance interface;

PS: eeplat (www.eeplat.com) is basically the product of this idea, but the overall analysis definition and general parsing execution of the system implemented by eeplat.

 

Www.eeplat.com QQ group: 105867861 (enter eeplat2014 for verification)


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.