Re: Swixml limitation?
Frank Meissner <[email protected]> Mon, 30 Aug 2004 19:08:00 +0200
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
Hello Troy, Troy Ames wrote: > I have been looking at Swixml and there appears to be a couple of > limitations supporting the common MVC pattern. Or perhaps I am just > missed something. > > I would like to have the capability to have multiple views on the same > instance of a model. This appears to only be supported by swixml if the > model is a singleton. You are right, if you do'nt want to have a 1:n, n=1... relation, you can't do this by swixml alone. You may of course have several empty classes descending from your desired model acting as "tagging classes". If you have that many tagging classes as you require "views per model" you are done. But of course, this is a bit clumsy... > In addition some views have more than one model. > To support the latter perhaps an extension of the initclass attribute > that allows a delimited list of models would be sufficient: > > <table initclass="MyTableModel, MyColumnModel, MyListSelectionModel" > ... /> > > If a constructor existed with all of the models in the correct order > then the engine would construct the view using it. > > The limitation with respect to controllers is that you cannot specify > controllers at a smaller granularity then one per swixml instance. I > would like to do something like: > > <frame id="frame_1" controller="MyFrameController" ...> > <panel id="panel _1" ...> > <panel id="subPanel_A" controller="MyAController" ... /> > <panel id="subPanel_B" controller="MyBController" ... /> > <panel id="subPanel_C" controller="frame_1" ... /> > </panel> > </frame> Not that elegant but sufficient enough for me is to render subpanels in separate controlers which are responsible for them. > > Subpanels A and B both have their own custom controllers limiting the > scope of contained actions. They could even have the same named actions > just different implementations (likely if you are including external > files). Subpanel C would reuse the controller specified by "frame_1". > This would provide greater flexibility creating a MVC based GUI. > > --Troy > > > > _______________________________________________ > Forum mailing list > [email protected] > http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com >