对UML及其工作原理感到困惑 [英] Confused about UML and How it really works

查看:72
本文介绍了对UML及其工作原理感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们被要求做这个项目,据说很简单,但是我们只做了一个星期的C#,希望有人可以帮忙...

不是我没有尝试!!!我做到了,但是没用...我输入的代码在底部..请看看您是否可以对此进行改进..

一切都是公开的:
我们必须创建一个称为Mutant的主类,该主类必须是抽象的,其中包含:CodeName(String),Level(int), DangerQuotient(int & abstract) and DisplayInfo

其他3个类称为:PsychicMutant-其中包含:IQ(int),UsageCount(int)DangerQuotient()

PhysicalMutant-其中包含:IQ(int),Strenght(int)和DangerQuotient()

ElementalMutant-其中包含:Region(int),DangerQuotient()

有一些公式可以计算出每个班级的危险商数,但我可以做到这一点

所有这些都链接到名为IDisplayable 的接口,该接口包含(public DisplayInfo())

请帮助....我真的很感激谢谢

//我做的代码!

==接口类==

We were given this project to do, it was said to be simple but we''ve only been doing c# for a week, hope someone can help...

It''s not that i didn''t try!!! i did but it did not work...the code i typed is at the bottom..please see if you can improve this..

Everything is public:
We have to create a Main Class called Mutant which has to be abstract--this contains : CodeName(String),Level(int), DangerQuotient(int & abstract) and DisplayInfo

The other 3 classes are called: PsychicMutant--this contains: IQ(int), UsageCount(int) and DangerQuotient()

PhysicalMutant--this contains: IQ(int),Strenght(int) and DangerQuotient()

ElementalMutant--this contains: Region(int), DangerQuotient()

There are formulas that work out the Danger Quotient for each class but i can do that lol

All this is linked to an interface called IDisplayable which contains (public DisplayInfo())

Please Help....I would really appreciate it Thanks

//Code That i did!

==Interface Class==

interface IDisplayable
{
void DisplayInfo();
}



==突变类==



==Mutant Class==

abstract class Mutant:IDisplayable
{
static void Main (String[]args)
{
public string CodeName;
public int Level;

void DisplayInfo();

abstract int DangerQuotient();
}
}



==精神突变类==



==Psychic Mutant Class==

class PsychicMutant:Mutant
{
public int IQ;
public int UsageCount;

public int DangerQuotient()
{
//Formula goes here
}



==物理突变体类==



==Physical Mutant Class==

class PhysicalMutant:Mutant
{
public int IQ;
public int Strenght;

public int DangerQuotient()
{
//Formula goes here
}



==元素变异类==



==Elemental Mutant Class==

class ElementalMutant:Mutant
{
public int Region;


public int DangerQuotient()
{
//Formula goes here
}




附言:我只寻求帮助,甚至寻求指导,我真的没想到2得到答案.我是一个勤奋的工作2,这是我的不得已....很抱歉,如果我给人留下了错误的印象




P.S i asked for help only or even guidelines, i really did not expect 2 get the answer. I am a hard worker 2 and this was my last resort....Sorry if i gave the wrong impression

推荐答案

0)不起作用"没有没告诉我们任何事情.

1)您的类或接口都不是公共的,应该公开.

2)您可以将IQ和强度(在代码中拼写错误)属性放入基本Mutant类中,因为所有派生类都需要它.

3)我认为最好使DangerQuotient virtualminstead成为抽象.然后,它将执行标准计算,程序员可以在派生类中覆盖该计算.

4)UML与这有什么关系?对于只有几个团队成员的小型项目,UML浪费大量时间.
0) "Doesn''t work" doesn''t tell us ANYTHING.

1) None of your classes or interfaces are public, and they should be.

2) You could put the IQ and Strength (misspelled in your code) properties into the base Mutant class since all of the derived classes are going to need it.

3) I think it would be better to make DangerQuotient virtualminstead of abstract. It would then perform a standard calculation that the programmer can override in derived classed.

4) What does UML have to do with this? UML is a massive waste of time for small projects with few team members.


这篇关于对UML及其工作原理感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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