To my surprise i'm able to do this:
public abstract class BaseComponent
{
protected GameObject GameObject;
internal BaseComponent(GameObject gameObject)
{
GameObject = gameObject;
}
}
public abstract class BaseComponent<TComponent, TManager> : BaseComponent
where ...
{
}
Is naming my 2 classes the same bad practice?
No.
Is there a standard naming convention in this case?
The same name is fine. cf. IEnumerable and IEnumerable<T>.
To my surprise i'm able to do this:
Why is it a surprise? It's intuitive, and is standard in the framework.
It is comparable to method overloading. Instead of having a lot of different method names for methods doing basically the same thing, the overloads help to create order. However, you should not abuse it. Classes, interfaces and methods with the same name really should implement the same idea with different flavors. Otherwise, it would be very confusing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With