(3) Entities and structures "using Objective-c's runtime characteristics, combined with fmdb to achieve a lightweight ORM"

Source: Internet
Author: User

Copyright notice: This article for Bo Master original article, without Bo Master permission not reproduced.

0. Roles required in this ORM

In this ORM, there are at least so many role entities, based on the expected needs and considerations that are presented earlier:

    • Overall, the mapping protocol "Bcormentityprotocol" that is responsible for database tables and entities

    • Data type entities supported by this ORM, such as Text,int ... "Bcsqlitetype"

    • Field constraint entity, whether the primary foreign key, such as "bcconstraints"

    • Foreign key reference entity, inter-entity relationship "Bcreference"

    • Operating conditions encapsulate the entity "Bcsqlparameter"

    • Operation Main entrance, ORM façade "Bcormhelper"

    • Instance table entity: "Studententity"

As to how the relationship between these roles is organized, you have to think about it ....


1, the whole UML structure diagram

Based on the entity classes listed above, the relationships between these classes are organized and the following UML diagrams are made:


This is the overall structure of the ORM, from the overall view, the structure is relatively simple and clear.

There are four ways to write back, the program is so, everyone's ideas are certainly different, but I can give the structure of the present, if you find that there is a big problem, or from the place worth improving, please correct me.





(3) Entities and structures "using Objective-c's runtime characteristics, combined with fmdb to achieve a lightweight ORM"

Related Article

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.