0
When I create a class diagram in VS2017 from existing classes, the relationship link does not appear.
namespace CloudEye.Domain
{
public class Car
{
public CarPlate CarPlate { get; private set; }
public double Capacity { get; set; }
public double Consumption { get; private set; }
public double Autonomy => Capacity * Consumption;
protected Car () { }
public Car(CarPlate carPlate, double capacity, double consumption)
{
CarPlate = carPlate;
Capacity = capacity;
Consumption = consumption;
}
}
}
namespace CloudEye.Domain
{
public class CarPlate
{
public string Characters { get; private set; }
protected CarPlate() { }
public CarPlate(string characters)
{
Characters = characters;
}
}
}
Do you say Inheritance? because in your code there is an aggregation!
– novic
Not inheritance, even aggregation. In the diagram there should be a line connecting the class Carplate to the property Carplate CAR-class.
– Matheus Saraiva
no... the line only appears when there is inheritance... it is a class diagram...not an ER model
– Rovann Linhalis
In fact the relation is of composition. In UML there are symbols for aggregation, composition, simple association, among others. Example But the visual studio apparently cannot identify the relationship between the classes.
– Matheus Saraiva
The VS even has the relationship links, as shows the image The problem is that it is not able to do "Reverse Engineering", i.e., assemble the diagram based on existing classes.
– Matheus Saraiva