嗨: 我正在使用任务发布系统。寻找建模模式
在系统中,也有一些部门,例如:开发/销售/产品等
属于不同部门的一些任务。
而最重要的型号:用户。
使用这个系统的人只是不同部门和老板(最大的老板)的老板)。
这些人都在管理页面工作,普通老板只能发布和看到他/她部门的任务。他/她可以添加/删除/修改任务(其中修改意味着他可以设置状态的任务:完成/完成/不开始),他/她的所有操作都应该由最大的老板验证。
的最大的老板可以看到/添加/删除/修改所有的任务,从所有的部门,也是他/她可以添加删除用户(普通老板),设置用户在未经许可的哪个部门的(任务用户可以看到)。
=================== 以下是我自己设计的:
Department
String name;//name of this department
List<Task> listAllTasks();// list all tasks belong to this department
Task
String name;
String desc;//description of this task
Date startTime;//when this task will start
Date endTime;
int status; //is this task done? doing? not starting?
String executorName; //the name of the person who will responsible for this task(here the person does not need to be common boss,just a name).
Department depart;//which department does this task belong to ?
Boss
String loginName;
String realName;
String password;
Department depart;//which department does this boss belong to ?
以上是我所有的想法,我不知道到继续做权威设计。
例如,最大的老板当然不属于任何部门,但他拥有最大的权力。
任何人都可以帮我一个忙吗?
顺便说一句,我将使用hibernate作为DAO和struts2作为网页控制器。
如何控制用户的权限?例如,当一个普通的老板登录时,我必须列出他有权限的所有任务,该怎么办? – hguser 2011-03-12 06:02:46
感谢您的关注。你可以使用XML配置文件吗?我从来没有使用和“讨厌”annoation .. :( – hguser 2011-03-12 08:18:22
)我真的很抱歉,编写hibernate xml映射现在已经超出了我的专业领域。如果你不需要任何兼容性问题来解决,我真的建议使用JPA-Hibernate的实现和注解,它更加简单和容易。 – zawhtut 2011-03-13 06:08:59