PDA

View Full Version : Is Ext JS really a MVC?



umr.ashrf
10 Jan 2012, 7:03 AM
I am starting with Ext JS now and was looking into it. I have been using Sencha Touch for few months as well. There is a question that keeps pop in my head all the time and for the sake of first conversation here in that part of forum I am going to ask this.

In Ext JS and Sencha Touch we can architect our applications with the model named MVC but when we actually do this, they are Models Views, Controllers and Stores. I know MVC very well but in case of Ext JS and Sencha Touch, shouldn't it be MVCS or SMVC?

Any comments?

mitchellsimoens
10 Jan 2012, 8:08 AM
A store and model are part of the Model part of the MVC

edspencer
11 Jan 2012, 12:27 PM
Technically yes - that's mostly a result of the fact that the data source is usually several hundred ms away so a local cache can give a much better experience to the user. Stores have always been a part of Ext JS so I guess when we introduced MVC we didn't give the naming much consideration :)

umr.ashrf
12 Jan 2012, 1:20 AM
Glad to know your comments.

el_chief
15 Jan 2012, 8:24 PM
ExtJS is somewhere between MVC and MVP, depending on how you let models talk to views (straight up data binding or delegating thru the controller)

http://en.wikipedia.org/wiki/Model-view-presenter (http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter)

A model in ExtJS does not have events, though stores do, so it is more like MsVP (models view presenter)

You probably want to use a Supervising Controller or Passive View type pattern (see Martin Fowler's site)

yujing
28 May 2012, 9:21 PM
Definitely Not.

In Sencha, Model is used to format the data(more like entity) we are going to use while putting all business logic in view.

And also not MVP.... far away.

umr.ashrf
28 May 2012, 10:50 PM
All the business logic is in Controller.

mitchellsimoens
29 May 2012, 5:51 AM
Model part is split between the Model and Store. There are many definitions of MVC, the one we took may not be one you are familiar with. Our MVC does allow for logic to be in the Controller but it's based on what you are doing if you need some logic in the view.

yujing
29 May 2012, 8:12 AM
TYPO.. should be controller

el_chief
8 Jun 2012, 11:25 AM
Definitely Not.

In Sencha, Model is used to format the data(more like entity) we are going to use while putting all business logic in view.

And also not MVP.... far away.

That is not a great solution. All data and data logic, and data validation should go in model. View should be dumb.