The Wildcats training design needs a shared Player type, but each concrete role must supply its own training task. Read the abstract contract, separate it from an implemented operation, and then represent both in Violet.
These complete declarations define an abstract Player and one concrete Goalkeeper. Name is inherited storage. GetTrainingTask has a required string result, but its base declaration has no body. The override supplies the concrete behavior.
public abstract class Player
{
public string Name;
public abstract string GetTrainingTask();
}
public class Goalkeeper : Player
{
public override string GetTrainingTask()
{
return "Practice saves";
}
}Define Player as an abstract base type
Keep the shared Name field in the base type
Require a GetTrainingTask operation with a string result
Leave that operation without a base implementation
Define concrete Goalkeeper as a derived Player
Supply its override returning Practice savesThese words describe the class contract, not a sequence of runtime actions. Identify the types, stored members, operation inputs and results, and relationships before choosing compartments and connectors.
Player and Goalkeeper.Player <abstract>, and add attribute +Name : string.+GetTrainingTask() : string <abstract>. The marker records the missing base implementation; do not invent a base return value.+GetTrainingTask() : string. Add a note Overrides the abstract operation; returns Practice saves. Draw solid generalization with its hollow triangle at Player.<abstract> is the Violet text marker for an abstract class or operation; standard UML can use italics. Do not underline the entries, which would mean static.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
Read from Goalkeeper up the generalization connector to Player. The derived class inherits Name and must supply GetTrainingTask. The expression new Goalkeeper() is permitted, but new Player() is not because Player is abstract.
A Player-typed reference can still point to a Goalkeeper. Calling GetTrainingTask through that reference invokes the concrete override and returns Practice saves; an abstract base type does not mean every reference declared with that type is null.