What's the right way to store private data in widget's instance?

What's the right way to store private data in widget's instance?

Sometimes I need some of instance variables to be private, so I can't store them in options. So far I see 2 ways to do this, but both have disadvantages:

First is to store them via .data() with a custom namespace, e. g.
  1. _create: function(){
  2.       this.element.data("myNS", {
  3.             myVar: "some value"
  4.       })
  5. }
This way seems pretty comfortable for me, but it is a straight violation of general jqueryUI coding standarts, which say:
 Don't save any data on the element other than the plugin instance.
It makes me feel less comfortable about this way, although I don't quite understand the reasons behind this guideline. BTW, jquery.ui.selectable makes it this way.


So the second way is to put our data directly into the plugin instance:
  1. _create: function(){
  2.       this.myVar = "some value"
  3. }
This gives us very nice syntax for accessing our properties and is not a violation of coding standards (afaik), but looks like a kind of global pollution. Of course, we can also create a namespace here to avoid pollution and naming clashes, e. g.
  1. _create: function(){
  2.       this._options = {
  3.             myVar: "some value"
  4.       }
  5. }

But it just doesn't look right. Or maybe it does?