You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should we use @var for referring to abstractions only (refer to SOLID for more info)
or should we use @var for referring to regular classes too?
Few cases may be discussed:
Foo class implements Foo interface. Foo class is the only class implementing the Foo interface. Now we want to use @var to say the property of class X is Foo.
Foo and Bar classes (both) implement Foo interface. Now we want to use @var to say the property of class X is Foo.
Foo class do not implement any interface and it is in vendors (a module of third party we use in our project...). Now we want to use @var to say the property of class X is Foo.
Foo class implements Foo interface, Bar class implements Bar interface. Also, Foo and Bar interfaces (both) extends Baz interface. Now we want to use @var to say the property of class X is Foo or Bar.
Same as 4 but we want to use @var to say the property of class X is Baz.
Consider describing @var usage outside of the class property scope too. For example, in certain places where additional temp variable is created inside the method to deal with the upcoming logic. For example, ORM query returns a specific object while the query return type is "mixed". In this kind of situation we would like to use @var to say it is Foo object.
Please consider IDE support when deciding. For example, we want IDE to provide the methods used, quickly jump to the implementations, etc.
The text was updated successfully, but these errors were encountered:
Should we use
@var
for referring to abstractions only (refer to SOLID for more info)or should we use
@var
for referring to regular classes too?Few cases may be discussed:
@var
to say the property of class X is Foo.@var
to say the property of class X is Foo.@var
to say the property of class X is Foo.@var
to say the property of class X is Foo or Bar.@var
to say the property of class X is Baz.@var
usage outside of the class property scope too. For example, in certain places where additional temp variable is created inside the method to deal with the upcoming logic. For example, ORM query returns a specific object while the query return type is "mixed". In this kind of situation we would like to use@var
to say it isFoo
object.Please consider IDE support when deciding. For example, we want IDE to provide the methods used, quickly jump to the implementations, etc.
The text was updated successfully, but these errors were encountered: