# Default store (w/o Ember Data)

**URL:** <https://discuss.emberjs.com/t/default-store-w-o-ember-data/15430>\
**Category:** General\
**Created:** [September 8, 2018, 7:07am UTC](https://discuss.emberjs.com/t/default-store-w-o-ember-data/15430 "2018-09-08T07:07:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablobm](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pablobm/32/11723_2.png) [@pablobm](https://discuss.emberjs.com/u/pablobm)\
**Post date:** [September 8, 2018, 7:07am UTC](https://discuss.emberjs.com/t/default-store-w-o-ember-data/15430/1 "2018-09-08T07:07:16Z")

</div>

Hello there. I’m doing some research of the bowels of Ember, and I have a question about how `@ember/routing/route` implements `store`.

I understand this implementation is normally expected to be overriden by Ember Data or what have you, and that it’s considered legacy, but still I’d like to know about the history of it.

So specifically: **why this line?** [ember.js/route.js at f73d8440d19cf86a10c61ddb89d45881acfcf974 · emberjs/ember.js · GitHub](https://github.com/emberjs/ember.js/blob/f73d8440d19cf86a10c61ddb89d45881acfcf974/packages/@ember/-internals/routing/lib/system/route.js#L1687)

```auto
modelClass = modelClass.class;

```

From what I can see, all it achieves is to throw the container out of the window (as the result of `.class` won’t have access to the container), which limits the usefulness of the result at all, if I understand correctly.

Thank you!

---

<div class="post-metadata">

**Author:** ![ryanto](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ryanto/32/13850_2.png) [@ryanto](https://discuss.emberjs.com/u/ryanto)\
**Post date:** [September 8, 2018, 4:24pm UTC](https://discuss.emberjs.com/t/default-store-w-o-ember-data/15430/2 "2018-09-08T16:24:24Z")

</div>

Someone with some more Ember knowledge might be able to provide a better answer… but I’ll try my best.

In the old days of Ember Data (1.x) we would fetch data using the model’s class.

```auto
// Ember Data 1.x style of data fetching
Person.find(1);

```

In Ember 2.12 the `factoryFor` API was added. This API returns an object with two properties, `create` and `class`. The class property points back to the original class…

```nohighlight
let Person = DS.Model.extend();
owner.register('model:person', Person);
let factory = owner.factoryFor('model:person');
factory.class === Person; // true
let alice = factory.create();

```

So if you wanted to call `Person.find()` you would need to first lookup the factory and then access the class property. Hence, `modelClass.class`

Check out the [factoryFor RFC](https://github.com/emberjs/rfcs/blob/master/text/0150-factory-for.md), it’s got some great examples!

---

<div class="post-metadata">

**Author:** ![pablobm](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pablobm/32/11723_2.png) [@pablobm](https://discuss.emberjs.com/u/pablobm)\
**Post date:** [September 9, 2018, 2:26pm UTC](https://discuss.emberjs.com/t/default-store-w-o-ember-data/15430/3 "2018-09-09T14:26:44Z")

</div>

Thank you! That explains some of it, and provides useful pointers for further research. I’ll return with more questions when I get stuck again 😄
