Teach you how to write an ORM (2)

Source: Internet
Author: User

I didn't go to bed last night. I thought I could go home from work and then snore. After dinner, I woke up. So I decided to advance the part I planned to write tomorrow.
Why don't I go to bed in the middle of the night? Pretend to be Wang zuxian

According to the previous requirements, we found that the configuration file needs to be abstracted into a component, and the cache needs a separate component. In order to adapt to different databases, we need to build a plug-in architecture, insert different processing components for different databases. To reduce the reflection cost, a component is required to include the interface definition. The main class is a loader that provides a loading and starting environment for data processing components.

In this way, we defineProgramThe structure is as follows:

Main project
Yourname. DB
Configuration
Yourname. DB. config
Interface
Yourname. DB. Interface
Data component plug-in
Yourname. DB. executer
Remember to replace yourname with your own name. Of course, I don't mind writing your own name.

A temporary contract can be formed between two unrelated projects by providing an interface ticket for another project to avoid the issue of circular reference.

Sleep. nap for a while. If it doesn't shine the day after tomorrow, let's continue to talk about how to implement real-time loading configuration.

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.