ca2longoria / handlar.js

Simple MVC without the V or the C.
MIT License
1 stars 0 forks source link

#3: Implement Array method overrides #4

Open ca2longoria opened 10 years ago

ca2longoria commented 10 years ago

Child of: Remove handle/ob duality (#3)


Read methods

Sort methods

Add methods

Remove methods

Accessor methods

* Present in more than one category

ca2longoria commented 10 years ago

I'm considering remvoing read methods from overriding. As it stands, they all simply call Array.prototype.*.apply(<Handle>,arguments), anyway.

Although... that would necessitate removing those properties, entirely. Otherwise, it would become too easy to mess with a Handle's internal structure.

Then, there's also the possibility of simply allowing the read methods access to the Handle objects, and include in the documentation a WARNING flag.

There are then three read possibilities:

  1. apply to this.$
  2. allow access to Handle objects
  3. remove these methods entirely
ca2longoria commented 10 years ago

Leaning toward option 2, allowing Handle access. But perhaps 2 & 3 may both work. Provide an argument or option, either at the Model or Handle level, probably the Model, that indicates whether or not to make read/accessor methods available.

Say, safe, or unsafe.

ca2longoria commented 10 years ago

What of Handle<primary> = [...]?

Not sure if this belongs in this Issue, but it is pertinent in testing against ArrayHandle's overridden methods.