第一范文网 - 专业文章范例文档资料分享平台

软件开发框架设计说明书

来源:用户分享 时间:2025/7/23 15:08:54 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

///

/// 自定义主键的前缀 ///

public System.String entity_prefix { }

private System.Int32 _entity_seq_length; ///

/// 自定义主键的自增长数字的长度 ///

public System.Int32 entity_seq_length { }

private System.String _entity_type; ///

/// 自定义主键的对象类别 ///

public System.String entity_type { }

get { return _entity_type; } set { _entity_type = value; } get { return _entity_seq_length; } set { _entity_seq_length = value; } get { return _entity_prefix; } set { _entity_prefix = value; }

[Column(IsIdentity=true)]

private System.String _entity_date; ///

/// 自定义主键的生成日期 ///

public System.String entity_date

private System.Int32 _entity_value; ///

/// 自定义主键的下一个值 ///

{ }

get { return _entity_date; } set { _entity_date = value; }

13

public System.Int32 entity_value { get { return _entity_value; } set { _entity_value = value; }

}

private System.Int32 _CorpID; ///

/// 公司ID ///

public System.Int32 CorpID {

get { return _CorpID; } set { _CorpID = value; } }

private String _date_format; ///

/// 自定义主键生成日期的格式 ///

public String date_format {

get { return _date_format; } set { _date_format = value; } }

private Int32 _add_value; ///

/// 自增长位的递增数 ///

public Int32 add_value {

get { return _add_value; } set { _add_value = value; } }

private String _entity_suffix; ///

/// 自定义主键的后缀 ///

public String entity_suffix {

get { return _entity_suffix; } set { _entity_suffix = value; }

14

}

private Int32 _default_value; ///

/// 自增长位的初始值 ///

public Int32 default_value {

get { return _default_value; } set { _default_value = value; } }

private Int32 _serial_no; ///

/// int类型自增主键值 ///

public Int32 serial_no {

get { return _serial_no; } set { _serial_no = value; } }

}

另外,如果用NHibernate做数据访问层,那所有的业务实体对象不仅要有结构定义,还要有与数据库中表的关系映射(即O/R Mapping)。 EntitySerialNO的O/R Mapping文件定义如下:

15

name定义的是实体对象类名,以“命名空间+类名,装配件名”表示,table属性定义的数据库中的表名。在

/>中name属性定义的仍然是实体对象中的属性名,而column属性定义的是数据库表中的字段名。

由于FrameworkCore框架在数据持久层采用Nhibernate框架,所以上面的O/R Mapping内容

将被保存在名为EntitySerialNO.hbm.xml的文件中,且要在VS2003中被设为潜入的资源,以便被Nhibernate调用。

EntitySerialNO的数据库定义如下:

create table dbo.EntitySerialNO (

entity_type nvarchar(50) not null, CorpID int not null, entity_prefix nvarchar(50) null, serial_no int not null, entity_value int null, entity_date datetime null, date_format nvarchar(50) null, entity_seq_length int null, add_value int null, default_value int null, entity_suffix nvarchar(50) null, memo nvarchar(50) null,

constraint PK_ENTITYSERIALNO primary key (entity_type) ) go

2.1.3.4 数据访问

数据访问对象的目的是将业务逻辑与数据库进行隔离,以便使业务逻辑能支持更多的数据库而无需修改一行代码。FrameworkCore框架主要是使用Nhibernate和ADO.NET交互来支持这一块的功能。在FrameworkCore框架中共定义了四种Dao对象类型接口,具体如下:

1) IDao:定义所有对象访问数据库的操作接口。 ///

/// Dao定义接口 ///

public interface IDao {

///

/// 插入对象 ///

/// void Insert(IModel model);

16

搜索更多关于: 软件开发框架设计说明书 的文档
软件开发框架设计说明书.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c36ibn0uyq64mg6283wek_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top