I know it's generally a design flaw to have an empty class, yet I'm wondering whether there are some cases where it isn't to have an empty (abstract) class to group objects. Especially when polymorphism is needed.
For example I have a group location. They can consist of an area, a line (a road for example) or a specific point (such as a house). In the data structure it only requires to contain the coordinates.
I know they all have at least a single point in common, yet it's really weird property wise when I would have a coordinate at my location class.
At the moment I was thinking of the following solution:
public abstract class Location {
}
public class Point: Location
{
public double X {get;set;}
public double Y {get;set;}
}
public class Line : Location
{
public double StartX {get;set;}
public double StartY {get;set;}
public double EndX {get;set;}
public double EndY {get;set;}
}
I know it's not a perfect example as there is another more correct solution to this case and there are probably objects for this solution found within the .Net libraries.
But how are things like this solved overall?
Location
folder and place your locations there. – Andy Jun 23 '16 at 7:50