Git Product home page Git Product logo

Comments (3)

ZYTSingleNoble avatar ZYTSingleNoble commented on August 12, 2024 3

数据库设计也是不要有数组的,字典的话,又是可以拆成对象的。操作数据库,还是按照数据库范式来

from jkdbmodel.

BillZong avatar BillZong commented on August 12, 2024

@ZYTSingleNoble @Haley-Wong 顺便问一下, 这种设计是不是要求库要具备表链接的功能?
例如:

@interface AClass : NSObject
{
    //其它属性
    ...
    //数组索引, 指向另外一个表(数组索引表, 每一个索引都指向另外一个表(详细的对象))
    @property (nonatomic, assign) NSInteger bClassIndex; 
}
//另一个文件
@interface BClass: NSObject
{
    //一堆属性
    ...
}

问题描述的不准确, 麻烦两位有空帮忙解惑😄

from jkdbmodel.

Haley-Wong avatar Haley-Wong commented on August 12, 2024

@BillZong Sqlite 支持多表链接和左外链接。
提供一些思路:如果对象里包含其他对象属性的话,主要是利用runtime解析属性的时候,需要做一些判断和嵌套解析。然后在数据库表的增删改查的时候,根据属性是否包含其他对象来做表的关联查询。
补充:
但是如果对象的从属关系比较复杂的话,比如对象里包含A子对象,A子对象又包含B子对象......很多层的话,处理起来依然很麻烦。Sqlite 是个轻量级数据库,应该只用来缓存少量数据,不太建议缓存各种大量和太复杂关系的数据。

from jkdbmodel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.