Published properties and non-published properties

I've round myself using published and non-published properties on enyo kinds at random lately and I've just realized I don't really know the difference between the two. Both have getters and setters and can be observed, used by computed values, and used for data bindings.

So what's the real difference between the two, and are there good reasons to be using one or the other?

Comments

  • Functionally, the only things you get from declaring a property in the published hash are generated setters (setXXX) and possibly better Ares support (haven't used Ares but I believe it uses that hash to find properties).

    Computed props and bindings both rely on observer support. Observer support relies on using the generic set(prop, value) (which is called internally by the generated setXXX) so any property set using that function works with all of those capabilities.

    I've waffled on whether or not to use the published hash in post-2.2 code and have recently decided to keep it primarily as a convention. I think it helps the code to be self-documenting.
  • So basically published properties are mostly about semantics in the sense that, once you publish them, this implies they're designed to be both accessible and configurable.
  • yup ... succinctly put
Sign In or Register to comment.