I don't know if MVC is the best approach. I'm more interested in DCI. With 
MVC your view and controller have to know how the data is stored, and 
that's why we're in this mess in the first place with loading the models 
every time. With DCI, you don't need the "models" loaded every time.

On Monday, March 12, 2012 12:48:33 PM UTC-7, Richard wrote:
>
> There is discussion about optimization of web2py.
>
> Basically, MVC is correct approach, but the way web2py implement it seems 
> to make scalling problematic.
>
> Web2py works pretty well for a couples of tables let says 20 to 50 tables, 
> but behind that the models files become long and since they have to be read 
> each time a single function from a controller is trigger your app start to 
> be less responsive with the amount of table or the number of lines you have 
> in the files you have in models folder.
>
> The idea of Bruno (and others don't know where it comes from first), is to 
> put the definition into modules folder that is read only once at boot time 
> when you start web2py. But it comes with a lot of drawback : appadmin no 
> longer work out of the box, you have to know programming classes and import 
> your models where you need them in your controller, etc.
>
> Bruno (and others) says that this approach allow to scale (raise the 
> number of db models without compromise the responsiveness of your app), so 
> it a great news.
>
> There is others solutions to allow scalling that are in developpement 
> principally : model_map 
>
> There is already submodel, but it is consider not DRY.
>
> The idea behind the model less alternative is to keep the simplicity of 
> web2py as allowing bigger app to run smoothly. Also, the idea is to pave 
> the way to scaling, because the models less approach is only one solution a 
> great programmer could take to allow it app to scale and before there is 50 
> differents solutions for scalling (not documented for most of them) it is 
> better to propose a path to follow for scalling.
>
>
> Richard
>
> On Mon, Mar 12, 2012 at 3:25 PM, Bruce Wade <bruce.w...@gmail.com> wrote:
>
>> agreed 
>>
>>
>> On Mon, Mar 12, 2012 at 12:16 PM, Pepe Araya <pepea...@gmail.com> wrote:
>>
>>> With all the post arguing about no models... I'm asking myself: why 
>>> web2py have "models" folder if it isn't the best way to do the work? only 
>>> for background compatibility? 
>>>
>>> what's the reason to load the models every time you make a request? is 
>>> because the automatic migrations? 
>>>
>>> are only questions, and why not made a huge change and optimization in a 
>>> brand new version of web2py?
>>>
>>> best regards,
>>>
>>>
>>>
>>> On Thursday, March 8, 2012 12:45:41 PM UTC-3, rochacbruno wrote:
>>>
>>>> another advantage is the fact that you can import modules, you cannot 
>>>> import models. it is very nice to import your tables on external scripts.
>>>>
>>>> http://zerp.ly/rochacbruno
>>>> Em 08/03/2012 12:11, "Anthony" escreveu:
>>>>
>>>> I think an additional advantage of the module approach is that the 
>>>>> module only has to be loaded once (when it is first imported), but the 
>>>>> model files have to be read on every request.
>>>>>
>>>>> Anthony
>>>>>
>>>>> On Thursday, March 8, 2012 10:04:11 AM UTC-5, Cliff wrote:
>>>>>>
>>>>>> Certainly we want to avoid processing unnecessary table definitions 
>>>>>> with every request. 
>>>>>>
>>>>>> It seems to me that the simplest solution is something like this: 
>>>>>>
>>>>>> if request.controller=='foo': 
>>>>>>   db.define_table('foo', Field...) # main table 
>>>>>>   db.define_table('foo_one_to_**ma**ny', Field(foo_id, 
>>>>>> db.foo...)...) 
>>>>>>   ... 
>>>>>>
>>>>>> What is the advantage of the no models architecture over this?
>>>>>
>>>>>
>>
>>
>> -- 
>> -- 
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.fitnessfriendsfinder.com
>>
>
>

Reply via email to