Re: patterns for web ui apps. mvc models
Hello, What do you make of the following ? A "view model" associated with each view (mostly for edit forms). This model (separate from LDMs encapsulating entities) would handle all FormComponent values and updates (select lists, etc..). At creation it would extract required entity properties and upon submit would be called to hydrate the entity with the changes and save. Up until recently I put most of this logic in the Panels alongside the actual components and the idea of calling services for saving entities from an IModel seems wrong somehow but I would be interested in your take on this ... Thanks! CN -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/patterns-for-web-ui-apps-mvc-models-tp1867567p4677441.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: patterns for web ui apps. mvc models
> Paging is definitely better left to the DB! Yep :-) Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
On Wed, Jul 2, 2008 at 6:00 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: >> I'm also worried about injecting repositories and such to UI >> components, because it easily leads to domain logic to leak >> to UI layer. > > Sometimes the dividing line is thin though. Take for instance sorting > and grouping of lists. Sometimes that is very specific for a UI > screen, and it is a better idea not to pollute your services/ daos > with it. Unless performance plays a role (sorting in DB query is often > better than in-memory with Java). Paging is definitely better left to the DB! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
> I'm also worried about injecting repositories and such to UI > components, because it easily leads to domain logic to leak > to UI layer. Sometimes the dividing line is thin though. Take for instance sorting and grouping of lists. Sometimes that is very specific for a UI screen, and it is a better idea not to pollute your services/ daos with it. Unless performance plays a role (sorting in DB query is often better than in-memory with Java). Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
On Wed, 02 Jul 2008, marco m wrote: > I hear you Thomas. Maybe I should ask the question another way...does > anyone out there encapsulate their data access layer/service layer within > their model or do people put that stuff in their pages/components? Is anyone > using any patterns? if not...i feel so last year! I'm also worried about injecting repositories and such to UI components, because it easily leads to domain logic to leak to UI layer. Lately we've been trying to put more domain logic and inject services to domain objects, and it is turning out pretty well. However, for many cases @SpringBean and friends are still excellent. For example when you have a DropDownChoice for selecting Foos and just put repository.findAll(Foo.class) to get the choice list. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations Oyhttp://www.ri.fi/ > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
> > On the topic of patterns I have a favourite quote from a golf > istruction book: "the best golf swing is one that gets the ball into > the hole in the fewest strokes". The patterns you find in books are > solutions that worked in the past for other people. Look at them and > decide if they work for your particular problem. If you can't decide, > you don't understand your problem domain yet. > > I agree 100%. I just find that a lot of the time I'm using well documented patterns whether I've read about them or not. Every now and then I'll read about a pattern and think, I do that. I think that most of what we do will likely be described either by a pattern, or by an anti-pattern. I think its useful if developers can talk the language of patterns because it helps them to communicate quickly using familiar concepts. I abhor the gratuitous use or misuse of patterns. Hope the golf is going well ;) -- View this message in context: http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18236567.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
Yes, we have a domain model which talks to stateless backend services. The "controller", i.e. the application flow and event handling is in the pages. We used to have a different architecture with Spring Webflow (that was in the dark ages of JSF) as the "controller". Since we're building a single app, we haven't found it necessary to abstract these control flows out of the pages. Your mileage may vary if you're trying to reuse the workflow across multiple clients. On the topic of patterns I have a favourite quote from a golf istruction book: "the best golf swing is one that gets the ball into the hole in the fewest strokes". The patterns you find in books are solutions that worked in the past for other people. Look at them and decide if they work for your particular problem. If you can't decide, you don't understand your problem domain yet. cheers, Thomas On Wed, Jul 2, 2008 at 9:30 AM, marco m <[EMAIL PROTECTED]> wrote: > > > > Thomas Mäder wrote: > > > > Wicket is a framework to write (mostly) statefulweb pages. Unlike other > > web > > frameworks it does not impose a particular way to structure the > > application > > logic beyond that. Think of it like, say, the QT widget set. It's a way to > > display information and to be notified of user interactions. > > > > Thomas > > > > PS: when did the notion start that design pattens had an intrinsic value? > > "Now new and improved with more patterns!" Patterns are ways to structure > > code WHEN IT NEEDS STRUCTURING. A HelloWorld app DOES NOT NEED PATTERNS. > > (sorry for the shouting, pet peeve) > > > > > > I hear you Thomas. Maybe I should ask the question another way...does > anyone out there encapsulate their data access layer/service layer within > their model or do people put that stuff in their pages/components? Is anyone > using any patterns? if not...i feel so last year! > -- > View this message in context: > http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18231819.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
Thomas Mäder wrote: > > Wicket is a framework to write (mostly) statefulweb pages. Unlike other > web > frameworks it does not impose a particular way to structure the > application > logic beyond that. Think of it like, say, the QT widget set. It's a way to > display information and to be notified of user interactions. > > Thomas > > PS: when did the notion start that design pattens had an intrinsic value? > "Now new and improved with more patterns!" Patterns are ways to structure > code WHEN IT NEEDS STRUCTURING. A HelloWorld app DOES NOT NEED PATTERNS. > (sorry for the shouting, pet peeve) > > I hear you Thomas. Maybe I should ask the question another way...does anyone out there encapsulate their data access layer/service layer within their model or do people put that stuff in their pages/components? Is anyone using any patterns? if not...i feel so last year! -- View this message in context: http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18231819.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
"joking about" On Tue, Jul 1, 2008 at 2:45 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > you mean taking a piss? > > -igor > > On Tue, Jul 1, 2008 at 11:42 AM, Rodolfo Hansen <[EMAIL PROTECTED]> > wrote: > > Igor, stop taking the piss... > > > > What he means is: Wicket is *NOT* an MVC framework... > > > > > > On Tue, Jul 1, 2008 at 2:35 PM, Sven Meier <[EMAIL PROTECTED]> wrote: > > > >> Well, in Wicket the markup doesn't do much (which is a good thing) > besides > >> layout. If you're correctly using CSS, the markup isn't even responsible > for > >> the look (and feel). > >> > >> I don't know if this qualifies it as a 'V' in MVC. > >> > >> Sven > >> > >> James Carman schrieb: > >> > >> On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius > >>> <[EMAIL PROTECTED]> wrote: > >>> > >>> > I've been thinking about the way in which wicket is an MVC framework > and > > whether people use it according to the MVC pattern. > > > > > The MVC pattern is bastardized - especially when it comes to web > application frameworks - up to the point that it is hardly useful to > use the term. Everyone seems to have their own interpretation. > > If you had to explain Wicket in MVC terms, my take would be that > components represent the Controller and View (together, just like > Swing), and the model is separated behind the IModel interface. But I > think it is better to just let the whole MVC mania behind us and > explain frameworks on their own terms :-) > > > >>> > >>> You could argue that the "view" is the markup file and the > >>> "controller" is the component/page class? > >>> > >>> - > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>> > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: patterns for web ui apps. mvc models
you mean taking a piss? -igor On Tue, Jul 1, 2008 at 11:42 AM, Rodolfo Hansen <[EMAIL PROTECTED]> wrote: > Igor, stop taking the piss... > > What he means is: Wicket is *NOT* an MVC framework... > > > On Tue, Jul 1, 2008 at 2:35 PM, Sven Meier <[EMAIL PROTECTED]> wrote: > >> Well, in Wicket the markup doesn't do much (which is a good thing) besides >> layout. If you're correctly using CSS, the markup isn't even responsible for >> the look (and feel). >> >> I don't know if this qualifies it as a 'V' in MVC. >> >> Sven >> >> James Carman schrieb: >> >> On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius >>> <[EMAIL PROTECTED]> wrote: >>> >>> I've been thinking about the way in which wicket is an MVC framework and > whether people use it according to the MVC pattern. > > The MVC pattern is bastardized - especially when it comes to web application frameworks - up to the point that it is hardly useful to use the term. Everyone seems to have their own interpretation. If you had to explain Wicket in MVC terms, my take would be that components represent the Controller and View (together, just like Swing), and the model is separated behind the IModel interface. But I think it is better to just let the whole MVC mania behind us and explain frameworks on their own terms :-) >>> >>> You could argue that the "view" is the markup file and the >>> "controller" is the component/page class? >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >>> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
Igor, stop taking the piss... What he means is: Wicket is *NOT* an MVC framework... On Tue, Jul 1, 2008 at 2:35 PM, Sven Meier <[EMAIL PROTECTED]> wrote: > Well, in Wicket the markup doesn't do much (which is a good thing) besides > layout. If you're correctly using CSS, the markup isn't even responsible for > the look (and feel). > > I don't know if this qualifies it as a 'V' in MVC. > > Sven > > James Carman schrieb: > > On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius >> <[EMAIL PROTECTED]> wrote: >> >> >>> I've been thinking about the way in which wicket is an MVC framework and whether people use it according to the MVC pattern. >>> The MVC pattern is bastardized - especially when it comes to web >>> application frameworks - up to the point that it is hardly useful to >>> use the term. Everyone seems to have their own interpretation. >>> >>> If you had to explain Wicket in MVC terms, my take would be that >>> components represent the Controller and View (together, just like >>> Swing), and the model is separated behind the IModel interface. But I >>> think it is better to just let the whole MVC mania behind us and >>> explain frameworks on their own terms :-) >>> >>> >> >> You could argue that the "view" is the markup file and the >> "controller" is the component/page class? >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: patterns for web ui apps. mvc models
On Tue, Jul 1, 2008 at 2:35 PM, Sven Meier <[EMAIL PROTECTED]> wrote: > Well, in Wicket the markup doesn't do much (which is a good thing) besides > layout. If you're correctly using CSS, the markup isn't even responsible for > the look (and feel). > > I don't know if this qualifies it as a 'V' in MVC. Well, I don't really want to get into a debate on what is a "V" in MVC or not. The CSS doesn't do anything by itself. It has to be applied to something to get the "view" doesn't it? The HTML is an essential part (the CSS is part too) of the view. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
Well, in Wicket the markup doesn't do much (which is a good thing) besides layout. If you're correctly using CSS, the markup isn't even responsible for the look (and feel). I don't know if this qualifies it as a 'V' in MVC. Sven James Carman schrieb: On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: I've been thinking about the way in which wicket is an MVC framework and whether people use it according to the MVC pattern. The MVC pattern is bastardized - especially when it comes to web application frameworks - up to the point that it is hardly useful to use the term. Everyone seems to have their own interpretation. If you had to explain Wicket in MVC terms, my take would be that components represent the Controller and View (together, just like Swing), and the model is separated behind the IModel interface. But I think it is better to just let the whole MVC mania behind us and explain frameworks on their own terms :-) You could argue that the "view" is the markup file and the "controller" is the component/page class? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: >> I've been thinking about the way in which wicket is an MVC framework and >> whether people use it according to the MVC pattern. > > The MVC pattern is bastardized - especially when it comes to web > application frameworks - up to the point that it is hardly useful to > use the term. Everyone seems to have their own interpretation. > > If you had to explain Wicket in MVC terms, my take would be that > components represent the Controller and View (together, just like > Swing), and the model is separated behind the IModel interface. But I > think it is better to just let the whole MVC mania behind us and > explain frameworks on their own terms :-) You could argue that the "view" is the markup file and the "controller" is the component/page class? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
> I've been thinking about the way in which wicket is an MVC framework and > whether people use it according to the MVC pattern. The MVC pattern is bastardized - especially when it comes to web application frameworks - up to the point that it is hardly useful to use the term. Everyone seems to have their own interpretation. If you had to explain Wicket in MVC terms, my take would be that components represent the Controller and View (together, just like Swing), and the model is separated behind the IModel interface. But I think it is better to just let the whole MVC mania behind us and explain frameworks on their own terms :-) Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
if it doesnt have patterns how will the enterprise architect be able to model it -igor On Tue, Jul 1, 2008 at 8:23 AM, Thomas Mäder <[EMAIL PROTECTED]> wrote: > Wicket is a framework to write (mostly) statefulweb pages. Unlike other web > frameworks it does not impose a particular way to structure the application > logic beyond that. Think of it like, say, the QT widget set. It's a way to > display information and to be notified of user interactions. > > Thomas > > PS: when did the notion start that design pattens had an intrinsic value? > "Now new and improved with more patterns!" Patterns are ways to structure > code WHEN IT NEEDS STRUCTURING. A HelloWorld app DOES NOT NEED PATTERNS. > (sorry for the shouting, pet peeve) > > On Tue, Jul 1, 2008 at 2:07 PM, marco m <[EMAIL PROTECTED]> wrote: > >> >> Hi guys, >> >> I've been thinking about the way in which wicket is an MVC framework and >> whether people use it according to the MVC pattern. >> >> Wikipedia has this to say: >> >> Model >>The domain-specific representation of the information on which the >> application operates. Domain logic adds meaning to raw data (e.g., >> calculating if today is the user's birthday, or the totals, taxes, and >> shipping charges for shopping cart items). >>Many applications use a persistent storage mechanism (such as a >> database) to store data. MVC does not specifically mention the data access >> layer because it is understood to be underneath or encapsulated by the >> Model. >> View >>Renders the model into a form suitable for interaction, typically a user >> interface element. Multiple views can exist for a single model for >> different >> purposes. >> Controller >>Processes and responds to events, typically user actions, and may invoke >> changes on the model. >> >> I'm interested in whether people are using the model to encapsulate service >> calls. In the wicket documentation I frequently see services in the page >> retrieving dtos and passing the dto to a component as a model. This seems >> to be in conflict with the description of a model in the mvc pattern. >> Wicket is supposed to be an mvc framework, so why do the examples put >> services/daos in the pages? >> >> What patterns are folks using for their wicket apps? >> -- >> View this message in context: >> http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18214140.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: patterns for web ui apps. mvc models
Wicket is a framework to write (mostly) statefulweb pages. Unlike other web frameworks it does not impose a particular way to structure the application logic beyond that. Think of it like, say, the QT widget set. It's a way to display information and to be notified of user interactions. Thomas PS: when did the notion start that design pattens had an intrinsic value? "Now new and improved with more patterns!" Patterns are ways to structure code WHEN IT NEEDS STRUCTURING. A HelloWorld app DOES NOT NEED PATTERNS. (sorry for the shouting, pet peeve) On Tue, Jul 1, 2008 at 2:07 PM, marco m <[EMAIL PROTECTED]> wrote: > > Hi guys, > > I've been thinking about the way in which wicket is an MVC framework and > whether people use it according to the MVC pattern. > > Wikipedia has this to say: > > Model >The domain-specific representation of the information on which the > application operates. Domain logic adds meaning to raw data (e.g., > calculating if today is the user's birthday, or the totals, taxes, and > shipping charges for shopping cart items). >Many applications use a persistent storage mechanism (such as a > database) to store data. MVC does not specifically mention the data access > layer because it is understood to be underneath or encapsulated by the > Model. > View >Renders the model into a form suitable for interaction, typically a user > interface element. Multiple views can exist for a single model for > different > purposes. > Controller >Processes and responds to events, typically user actions, and may invoke > changes on the model. > > I'm interested in whether people are using the model to encapsulate service > calls. In the wicket documentation I frequently see services in the page > retrieving dtos and passing the dto to a component as a model. This seems > to be in conflict with the description of a model in the mvc pattern. > Wicket is supposed to be an mvc framework, so why do the examples put > services/daos in the pages? > > What patterns are folks using for their wicket apps? > -- > View this message in context: > http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18214140.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: patterns for web ui apps. mvc models
On Tue, Jul 1, 2008 at 5:07 AM, marco m <[EMAIL PROTECTED]> wrote: > Wicket is supposed to be an mvc framework, so why do the examples put > services/daos in the pages? it is? that is big news to me. -igor > > What patterns are folks using for their wicket apps? > -- > View this message in context: > http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18214140.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
patterns for web ui apps. mvc models
Hi guys, I've been thinking about the way in which wicket is an MVC framework and whether people use it according to the MVC pattern. Wikipedia has this to say: Model The domain-specific representation of the information on which the application operates. Domain logic adds meaning to raw data (e.g., calculating if today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items). Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the Model. View Renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. Controller Processes and responds to events, typically user actions, and may invoke changes on the model. I'm interested in whether people are using the model to encapsulate service calls. In the wicket documentation I frequently see services in the page retrieving dtos and passing the dto to a component as a model. This seems to be in conflict with the description of a model in the mvc pattern. Wicket is supposed to be an mvc framework, so why do the examples put services/daos in the pages? What patterns are folks using for their wicket apps? -- View this message in context: http://www.nabble.com/patterns-for-web-ui-apps.--mvc-models-tp18214140p18214140.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]