简单Web门户的UML类图 [英] UML class diagram for simple web portal

查看:209
本文介绍了简单Web门户的UML类图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问你关于我的班级图。我正在为周末大学学习的简单网络门户制作课程图。制作正确吗?如果我是我,你会怎样改变?用例,您可以在这里



对于您的回答,我将感到非常高兴。在这里,您可以找到WhiteStarUML程序的XML文件



注意我在该答案中提供的模型与 UserManager ContentManager 一样如何包含操作其他类的代码。除非人们实际扮演这些角色,否则您不需要这些角色。请注意,它在每个关联的末尾都具有动词短语和多重性,以告诉您事物之间为什么相关。请注意,这些类上没有普通的CRUD操作,例如创建,更新和删除。



一旦有了分析模型,则应将操作分配给适当的类,这些类通常会反映您的用例。例如,您的 Comment 类可能具有 edit()操作。但是可能不会。您可以考虑在 Article 类中进行名为 replaceComment()的操作(如果这是您的域的工作方式)。我不知道您的域应该如何工作,因为您缺少向我传授知识的分析模型!



完成分析模型后,我会制作一个设计模型,以解决方案领域的问题来增强它的功能,例如将用户登录到系统中。 这是另一个问题的答案,您可能会发现它对从分析到设计的转变很有帮助


I want to ask you about my class diagram. I'm making a class diagram for simple web portal for my weekend university studies. Is it made correctly? What would you change if I you were mine? Use cases you can find here Class diagram from use case diagram.

Should I create each user class separately? I mean Admin class, Redactor class, Moderator class etc. I've used privileges field (see User class) to simulate each user's role. Is it correct?

I imagine that ContentManager class holds User class instance and it is used inside Article, Announcement, Advertisement and Comment class to check whether these action is allowed.

I would be very glad for your answers. Here you can find XML file for WhiteStarUML program my XML file

解决方案

What you should do is create an analysis model of your domain. That model would contain classes like Article, Announcement, etc., as you have in your current diagram. For an example, please refer to another answer I recently posted to someone else's question. The diagram for that answer is shown again here for your convenience:

Notice how the model I provided in that answer has nothing like a UserManager or a ContentManager that just contains code to manipulate other classes. You don't want those, unless people actually play those roles. Notice how it has verb phrases and multiplicities at the ends of every association to tell you why things are related. Notice how there are no mundane CRUD operations on those classes, like create, update, and delete.

Once you have an analysis model in place, then you should allocate actions to the appropriate classes, which will usually mirror your use cases. For example, your Comment class might have an edit() operation. But it might not. You might consider having an operation called replaceComment() in the Article class (if that's how your domain works). I don't know how your domain should work because you are missing an analysis model that teaches it to me!

After you complete an analysis model, then I would make a design model that augments it with solution-domain concerns, such as logging a user into the system. Here is an answer to another question that you may find helpful for moving from analysis to design.

这篇关于简单Web门户的UML类图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆