A connector must distinguish implementing an interface from inheriting a concrete class or merely referring to an object.
This is the same minimal ITrainable contract and Player implementation. The source colon introduces interface implementation here because ITrainable is declared as an interface.
public interface ITrainable
{
void RecordTurn();
}
public class Player : ITrainable
{
public int NumberOfTurns;
public void RecordTurn()
{
NumberOfTurns = NumberOfTurns + 1;
}
}Define the ITrainable contract requiring RecordTurn
Define Player with its own turn-count field and public implementation
State that Player implements ITrainable
Connect the implementation to the contract
Do not introduce a stored interface fieldThese 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 an interface box named ITrainable visibly marked <<interface>>. If using an ordinary class-shaped box, retain the stereotype.+RecordTurn() : void in the interface operation compartment. In Player add +NumberOfTurns : int and its public +RecordTurn() : void operation.realizes. Check that the connector is not a solid inheritance line or a plain reference arrow.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
Read the connector as Player fulfills ITrainable. It does not mean an interface object is stored inside every Player or that a message is being sent.