您的位置:首页 > 移动开发

The first thing to do – DB design

2008-12-08 19:49 411 查看
数据库准备
我们从今天起开始做一个更接近实际的例子,以便更深入的探讨MVC 的各种特性。
一般工作中的项目负责人会启动一个新的工作任务,并明确该项目的具体工作成员。为了最终完成工作任务,他需要了解成员的每日工作情况(工作报告),工作进展情况, 并可能根据报告给出处理意见和建议。
生活中,不能能保证每个成员都在线,那么一条短信或电子邮件就是很好的辅助。
最后,工作任务都会结束,即便最后的结果是未完成或未完全完成。那么,负责人就应该对此工作给出最后的结语。
下面是根据以上情况简单设计的数据库表,我们今后的应用开发都会基于此数据库结构。细心的读者会发现没有记录用户信息的表,是因为我们将采用asp.net  membership来处理应用的安全及用户信息,非常方便易用。

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

The first thing to do – DB design
The application I am going to develop is a task management application, which will carry general requirements in team manage.
 Let’s say project leader launch a mission (Task) that is expecting to be completed in certain amount of time. He assigns this mission to several team members. He would be interested at the process of the mission, how it is going, what phase it is at, who is dealing with what etc.  In short, he may want to know exactly every member’s daily duty. After the leader receives report from team members, if it is necessary, he may make comment to the member. For instance, give the member a working tip or suspend the member to cope with something urgent. 
In real world, you cannot expect people online all the time, so a short message may be handy beside email notification.
At the end, mission has to be closed whether it is completed or not, but leader could leave a comment to summarize the whole job.  Ok, that’s pretty much scenario we need to know about goal of this application. Let’s begin with database design:
The following is the database tables we will need for the application. It’s pretty simple, so no more gossipy word. Please see the tables in the following.
 

任務表 (TASK)

任務序號IntTaskID
任務名稱nvarchar(50)TaskName
任務描述nvarchar(300)TaskDescription
任務狀態BitFlag (History)
建立日期Date
CreateDate
啟動日期Date
StartDate
計畫完成日期Date
EndDate
關閉日期Date
CloseDate
行號UniqueRowGuid
关闭注释
Nvarchar(1000)
CloseComment
                                                                                                                       
 

任務任命用戶表 (TASKUSER)

任務用戶序號IntTaskUserID
任務序號IntTaskID
用戶序號UniqueUserID
發起人標記
BitUserTaskRoleFlag
行號UniqueRowGuid
 

任務詳情表 (FOOTAGE)

任務詳情序號IntFootID
添加日期DateTimeCreateDate
描述nvarchar(1000)
Description
行號UniqueRowGuid
发起人注释
Nvarchar(1000)
Comment
注释日期
Datetime
CommentDate
用戶序號
UniqueUserID
 

附件表 (ATTACHMENT)

附件序號IntAttachmentID
任務詳情序號IntFootID
附件Vbinary(Max)Attachment
行號UniqueRowGuid
附件名称
Nvarchar(50)
FileName
附件类型
Nvarchar(50)
FileType
 

 

短信表 (SMS)

短信序號
IntMessageID
發出用戶序號UniqueUserID
接受用戶序號UniqueUserID
短信
Varchar(100)Message
已讀標記BitFlag
行號UniqueRowGuid
You may wondering why there is not User table that contains people information.  You are right, there is not user table in this design, because I am planning to implement Asp.Net membership as security control and user store. It’s easy and efficient.
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐