# Object accessor class interface

**URL:** <https://es.discourse.group/t/object-accessor-class-interface/244>\
**Category:** 💡 Ideas\
**Created:** [February 28, 2020, 5:16pm UTC](https://es.discourse.group/t/object-accessor-class-interface/244 "2020-02-28T17:16:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnini](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/mnini/32/253_2.png) [@mnini](https://es.discourse.group/u/mnini)\
**Post date:** [February 28, 2020, 5:16pm UTC](https://es.discourse.group/t/object-accessor-class-interface/244/1 "2020-02-28T17:16:49Z")

</div>

Object accessor

```javascript
obj[>this<]

```

should have method like get and set in class for automatic proxy creation

```javascript
class {
    accessor read( acessor ) {
         return this[acessor]
    }
    accessor write( acessor, written ) {
         return this[written]
    }
   
}

```

This syntactic sugar saves time and space to create a Proxy. This way proxy can be directly created along with objects, with no need to separate factory to have proxyfied objects.

- Possibly it could read even objects ( relations would be extremely readable then )
- It could have "pass" keyword integrated, so we can parse accessor and then pass "return pass" or "pass = written" or "pass()" to signalize that we want to access what would be accessed by original access.

---

<div class="post-metadata">

**Author:** ![bergus](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bergus/32/152_2.png) [@bergus](https://es.discourse.group/u/bergus)\
**Post date:** [March 3, 2020, 9:24pm UTC](https://es.discourse.group/t/object-accessor-class-interface/244/2 "2020-03-03T21:24:02Z")

</div>

Sorry to be blunt, but it's totally unclear what you are trying to achieve here, what you would expect that syntax to do, or what the possible use cases are.

---

<div class="post-metadata">

**Author:** ![mnini](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/mnini/32/253_2.png) [@mnini](https://es.discourse.group/u/mnini)\
**Post date:** [March 3, 2020, 10:18pm UTC](https://es.discourse.group/t/object-accessor-class-interface/244/3 "2020-03-03T22:18:41Z")

</div>

Proxy definition whitin object itself?
