TL;DR: I think you should use this template:
@property name
@type {type}
@public/@private
As suggested by Gaurav add @readOnly
if you use .readOnly()
or computed.readOnly()
, and @default
if it has a default value (not null
or undefined
).
Explanation:
As for the @method
question: no, please no! Look at it from the perspective of the consumer of your object (that's what your API docs are basically for). You cannot call object.property()
as you would for a method. But as long as you use Ember's getters and setters (which you should always do), the CP behaves exactly as a static property. And the value of it is not the Ember.ComputedProperty
instance, it is the value that this instance returns. So weather it is a CP or a static property is totally transparent to the consumer, and always should be, so you can change a static property to a computed one or vice versa at any time without breaking things!
And try to always specify the access keyword like @public
or @private
, as this helps to define and reason about the public API of your "thing". Only the public properties/methods may be used by the consumer of let`s say your component as well only those should be subject to unit or component integration tests, while you retain the freedom to always change your private stuff as long as the public API does not change.
And please, do not use the @final
keyword. The docs might be a bit misleading there, but final
is a pretty common keyword in other (classical object oriented) languages, that says that you may not override this property/method in a child class. So unless this is the case, don't use it.