GAE 数据存储中的视图
该应用程序是一个简单的任务管理系统,其中一个员工可以有多个任务,一个任务可以分配给多个员工。因此,第一个模型是 Employee,它具有以下属性:
Class Employee {
Long id; //primary key
String name;
String employeeCode;
String position;
}
任务模型如下:
class Task {
Long id //primary key
String name;
String description
}
并且将员工分配给具有以下关系的任务:
Class EmployeeTasks {
Long id // primary key
Long employeeId;
Long TaskId;
Date assignedDate;
Long assignedBy; //employee ID
}
我有两个用于员工模块的列表视图(通过 AJAX) -
第一个列表有以下列,它是供系统管理员使用的:
Employee code | Name | Position | Date Created
第二个列表有以下列,是供经理使用的:
Employee Code| Name | Position| No of Tasks assigned | Date of last assignment
我知道在 GAE 中,我们在设计数据库模型时需要考虑查询(视图)。所以我的问题是上述模型是否适合我的要求?
该应用程序正在GAE+Spring+JDO+Jackson+YUI 中开发。坚持使用这个模型并使用 Jackson ObjectMapper 来更改视图是否有意义?或者为视图编写非持久对象是一个好习惯吗?
The application is a simple task management system in which an employee can have multiple tasks and a task can be assigned to multiple employees. So the first Model is Employee, which has the following attributes:
Class Employee {
Long id; //primary key
String name;
String employeeCode;
String position;
}
The task Model is as follows:
class Task {
Long id //primary key
String name;
String description
}
and an employee is assigned to tasks in the following relation:
Class EmployeeTasks {
Long id // primary key
Long employeeId;
Long TaskId;
Date assignedDate;
Long assignedBy; //employee ID
}
I have two list views(through AJAX) for the employee module -
The first list has the following columns and it is intended for System Administrators:
Employee code | Name | Position | Date Created
The second list has the following columns and is for the Managers:
Employee Code| Name | Position| No of Tasks assigned | Date of last assignment
I know that in GAE we need to consider the queries(views) while designing the database model. So my question is whether the above model is ideal for my requirements?
The application is being developed in GAE+Spring+JDO+Jackson+YUI. Does it makes sense to stick on with this model and use Jackson ObjectMapper to change the views? Or is it a good practice to write non-persistent objects for the views?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论