-3

I've learned the UML recently and I am trying to build a MonsterDuel system. However, there are a lot of classes in this project, and I am confused about the abstract class and its usage. Now, I have created:

  1. Abstract class Players, and its inherited class Player.
  2. Abstract class Field, and its subclasses: Monster, Spell, Tomb, FieldSpell, and CardDeck.
  3. The multiple card classes associated with each other. The Monster, SpellCard, and TrapCard form up the entire PlayerCardSelection.

To be specific, I will try my best to wrap up the questions.

  1. Are there any rules or principles to determine if the UML a good design before coding?
  2. I am not sure if the abstract class can inherit another abstract class.
  3. If it is bad, how and what can I do to improve?

What I've tried is to separate the entities that I think is independent of the others. For example, I can add players by initializing the instance in the Player class, and inherited the attributes from the abstract class Players.

For the card section, I did a hierarchy structure to form up a card deck that can be selected and used by a player.

I haven't added all of the setter and getter, just want it to be as clean as possible. Any help is highly appreciated.

enter image description here

  • If you lower it down to the use of abstract classes it would be a valid question on SO (where you previously asked but also in a too broad way). You can not ask on opinions. Only on facts. – qwerty_so May 7 at 13:45
  • right, thank you. I'll specify next time. – Woden May 7 at 13:47
0

Are there any rules or principles to determine if the UML a good design before coding?

Yes. Show it to a fellow programmer and ask if they understand what the UML is even trying to say.

I am not sure if the abstract class can inherit another abstract class.

Yes. So long as eventually you get to a concrete class. Too much of this will give you the yo-yo problem.

If it is bad, how and what can I do to improve?

Talk to the fellow programmer about the issue that is making it bad and find a different way to satisfy your requirement.

I can't do any of this with you though because I can't even read this thing. You have too much going on for one page.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.