Re: Trying to wrap my head around Diez's MVC page model...
"Diez B. Roggisch" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Garth, > I feel like I'm starting to understand the MVC model a bit. When > looking at the example pages in the project I see stuff that > looks to me like Controller (notifyListeners->handleEvent) and > View (render->handleViewEvent), but nothing that really jumps > out at me as a Model... By Model I mean taking input and > using it to challenge a datasource (file, database, calculation, > system variable, etc) to produce a result which gets fed back > to the view... > > It could just be that that all the examples in the Models directory > (ChildFormMap, ExampleFormMap, ParentFormMap) define only > FormElements is what's confusing me. > > Do I just define some classes in the Models directory and call > them or is there something more to it? There are a few things that the pages do for you: 1) They remove the necessity of rendering-events. When there are no more control events, the page found in the session or event context gets rendered 2) The page works as a type-safe container for whatever data or models you want to encapsule. You mentioned the FormMaps - if you look closer, you'll notice that these are RepopulationFormMaps, thus they also are TemplateModels. So there is your data. 3) The pages allow you to implement various interfaces that represent common content in your webpage. In my examples its the navigation. Thats what the defaultModels and handover methods are for. Hope that helps, Diez