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
Somehow I don't like how those annotation classes are so verbose and boilerplate-y.
But I suppose it is a matter of taste, and it would be futile trying to convince you.
slootjes:
I would rather call it explicit, a matter of taste I guess :-)
I think what I don't like is all the setters and getters, made necessary by the base class ConfigurationAnnotation, and its constructor mechanics.
The setters are only called in a "magical" way in the constructor.
Also the getters are never going to be called from outside.
So..
setters could be protected
getters could be private
getters could be removed completely, and the modifyRoute() would directly access the private properties instead.
I was thinking that the base class could be replaced. The constructor would then write to the private properties directly instead of calling the setters. However, to do this from a base class, the properties would have to be protected instead of private. I like private :) So this means the setters should stay, but can be protected.
I was also thinking to remove the private properties completely and replace them with an associative array. However, this would prevent the PhpStorm annotation plugin from doing autocomplete.
The text was updated successfully, but these errors were encountered:
From #7
donquixote:
slootjes:
I think what I don't like is all the setters and getters, made necessary by the base class ConfigurationAnnotation, and its constructor mechanics.
The setters are only called in a "magical" way in the constructor.
Also the getters are never going to be called from outside.
So..
I was thinking that the base class could be replaced. The constructor would then write to the private properties directly instead of calling the setters. However, to do this from a base class, the properties would have to be protected instead of private. I like private :) So this means the setters should stay, but can be protected.
I was also thinking to remove the private properties completely and replace them with an associative array. However, this would prevent the PhpStorm annotation plugin from doing autocomplete.
The text was updated successfully, but these errors were encountered: