PDA

View Full Version : Is it mandatory to extend Ext.data.Model?



Aadmi
5 Dec 2011, 4:04 PM
Hi,

I am looking to design my app to separate core logic from the presentation framework. As such, I would like my data to be extremely lightweight, framework-agnostic DTOs (like Javabeans).

The Ext.data.Model object looks incredibly complicated (the base class itself has 11 configs, 9 props, and 55 methods!) where perhaps a choice of mixins or decorators might have kept the complexity at bay, on a pay-for-usage basis.

Is there any way to use straight, bare-bones JavaScript objects (name-value) as the model. I understand the store would have to pick up the slack, but that's OK. I can make my stores framework-specific.

Thanks.

skirtle
5 Dec 2011, 5:46 PM
I think you're worrying unnecessarily. It may have 55 methods but they're all on the class prototype, there's no extra penalty on each instance.

Trying to get by without models would be very, very difficult. There aren't many components you could use without them.