在模块第一次被目标程序使用即开始动态加载过程时,首先运行的是调用库的库初始化代码(Library initialcode),它通过指定的系统调用来初始化库中的模块重定位表基地址指针。
基于1个网页-相关网页
如果该表不存在,则它调用数据库初始化代码ResourcesDatabaseInitializer,该代码在此示例中是初始化数据库的实用程序类。
If the table doesn't exist, it invokes the database initialization code, ResourcesDatabaseInitializer, which in this example is a utility class that initializes the database.
在Seed文件之前,不存在初始化的惯例,许多开发人员把代码放入迁移中,这样容易混淆创建数据库和填充数据库之间的不同之处。
Prior to the seed file, no convention existed for initialization, and many developers put code in migrations, clouding the differentiation between creating the database and populating it.
应用推荐