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)
任務任命用戶表 (TASKUSER)
任務詳情表 (FOOTAGE)
附件表 (ATTACHMENT)
短信表 (SMS)
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.
我们从今天起开始做一个更接近实际的例子,以便更深入的探讨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)
任務序號 | Int | TaskID |
任務名稱 | nvarchar(50) | TaskName |
任務描述 | nvarchar(300) | TaskDescription |
任務狀態 | Bit | Flag (History) |
建立日期 | Date | CreateDate |
啟動日期 | Date | StartDate |
計畫完成日期 | Date | EndDate |
關閉日期 | Date | CloseDate |
行號 | Unique | RowGuid |
关闭注释 | Nvarchar(1000) | CloseComment |
任務任命用戶表 (TASKUSER)
任務用戶序號 | Int | TaskUserID |
任務序號 | Int | TaskID |
用戶序號 | Unique | UserID |
發起人標記 | Bit | UserTaskRoleFlag |
行號 | Unique | RowGuid |
任務詳情表 (FOOTAGE)
任務詳情序號 | Int | FootID |
添加日期 | DateTime | CreateDate |
描述 | nvarchar(1000) | Description |
行號 | Unique | RowGuid |
发起人注释 | Nvarchar(1000) | Comment |
注释日期 | Datetime | CommentDate |
用戶序號 | Unique | UserID |
附件表 (ATTACHMENT)
附件序號 | Int | AttachmentID |
任務詳情序號 | Int | FootID |
附件 | Vbinary(Max) | Attachment |
行號 | Unique | RowGuid |
附件名称 | Nvarchar(50) | FileName |
附件类型 | Nvarchar(50) | FileType |
短信表 (SMS)
短信序號 | Int | MessageID |
發出用戶序號 | Unique | UserID |
接受用戶序號 | Unique | UserID |
短信 | Varchar(100) | Message |
已讀標記 | Bit | Flag |
行號 | Unique | RowGuid |
相关文章推荐
- Justice: What's the Right Thing to Do
- [转][经典]What is the right thing to do?
- 转载:做正确的事情,等着被开除(Do the right thing, Wait to get fired)
- 哈佛:孰对孰错 中英字幕 What's the right thing to do
- JUSTICE∶What’s the Right Thing to Do 正义∶一场思辨之旅. 公正:该如何做是好?
- 《公正:该如何做是好?》(Justice: What's the Right Thing to Do? )【youtube上最受欢迎讲座】【哈佛大学最受新生喜爱公共课】【更新BBC里斯讲座】
- How to write first thing in the morning
- Typically the sat nav not to mention interested in your follow might long been do not ever so easy not to mention more comfortable
- How to do Research At the MIT AI Lab
- CompBar: The first attempt to stop component hell.
- The only thing I can think of is to use something like "http://www.dyndns.org/cgi-bin/check_ip.cgi" others may have a be
- 解决"Sorry, but you don’t have the administrative privileges needed to do this."的方法 wordpress, pagelines, eco
- NodeMailer发送邮件报unable to verify the first certificate
- Becoming an Xperf Xpert Part 4: What Did the WDIService Host Ever Do To You?
- checked_delete问题: Beyond the C++ STL: an introduction to boostdeleter::do_it
- About the issue of After delete a record from grid and refresh the datasource, the cursor go to first top record.
- Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser
- gpexpand error:Do not have enough valid segments to start the array.
- the things just need to do
- 微信小程序一个坑的地方(uploadFile:fail Error: unable to verify the first certificate)