Jena, yes that is the general idea but sometimes a "portlet" approach is really more efficient.
I assume this : 1) A very high traffic application cannot perform well with no caching. 2) A quite big application is really more efficient when is divided into small logical unit that are able to run / cache / refresh by themselves. Example: You have a sidebar menu that in base of the event running generate a different output ( selected item, tree opened etc......). You have an event-handler that broadcast a controller to prepare data ( lets' say from a db or xml as you like ) and push into event objetc. Your view take the data and make the output. This is done for any event/page. I can cache the hanlder: yes that's help but my logic/query run in any case. I can cache the view ( assuming that cache over an include in MG will work, now is not ): yes but controller is fired in any case. I will not use resources to make the output but I still run en event with no need to use the data returned by that. Better way: I can cache the view ( in base of the event where is running ans maybe a userid if needed ). If no cached view run first time firing the event from the view itself , making the output and caching it. If you reload page no hit to event/controller is done. Just include html. When cache expire viewlet will run logic and cache again. Sometimes that's a great way to use the event-handler system that an mvc framework is able to give you. This is not attempting to destroy MVC pattern but simply a better way to use it in cases where your application allow you to do that. Andrea On 27 Mag, 01:14, denstar <[email protected]> wrote: > On Tue, May 26, 2009 at 1:12 PM, andreacfm wrote: > > > Hi, > > > I was trying to implement a sort of view-let in MG. > > Is there a way to runa specific eventhandler from a view. > > > Something like runEvent('myEvent') > > With MVC, the idea is that the controller handles the events (by > talking to your model, hopefully), vs. spreading your event logic > throughout your app (like in your views). > > Seems sorta like it should be MCV, neh? > > At least that's my [limited] understanding of the pattern. > > The most a view should do would have a link to the event, not run the > event itself (the controller should have done that, if it was needed). > > I think. :) > > -- > We can recognize the dawn and the decline of love by the uneasiness we > feel when alone together. > Jean de la Bruyere --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
