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"