Thanks you all for replies. I am slowly realising the paradigm shift in that mostly everything is executed on the client. Nevertheless I would still tend to think that the MVC is applicable in that case. For instance, there could be at least 2 ways to respond to client's clicking on a menu item: a) a completely new page (with possibly its own gwt generated js) is served b) something happens in within this page.
when you take a look at situation b), then I would want to see some type of mvc implementation in the applicable .js file. Examples show that in such a case an event listener should be attached to a menu item that could theoretically render an imaginary table in the middle of the page. I wonder if event-based development the only, or possibly recommended way to program behavior? While as I am writing it, I am slowly being convinced that it is :) Though I am still concerned that through attaching events to components the code could easily become unmanageable. Another preemptive question. If I want my dwr project to have multiple html pages with generated js. Does in that case each html page corresponds to a different module and linked to a separate class that implements EntryPoint interface. Thank you lots. On Jan 28, 5:33 pm, Ian Petersen <[email protected]> wrote: > On Wed, Jan 28, 2009 at 8:10 AM, asdf_asdf <[email protected]> wrote: > > I am new to GWT and evaluate it currently. Just happily went through > > the official tutorial and full of questions taunting my mind. > > Just a quick background (should my question seem a bit messy): I am > > coming from php field and have in past have been using a mvc framework > > (CodeIgniter) where links/forms on a single webpage are mapped to > > methods of a controller responsible for calling buisiness logic and > > putting together view components. So... > > > * Is MVC the recommended design pattern to develop GWT applications? I > > see then the class implementing EntryPoint interface as being a > > "controller", but what would be a view in that case? I am struggling > > to understand the relationship between html-page and the controller > > that gets called: does each controller get called by the html-page > > that loads the appropriate javascript file and how could a controller > > have methods mapped to specific a user actions. For instance, after a > > specific link is clicked a new widget is shown (in the tutorial this > > is achieved through listeners, but can there be a url to method > > mapping as well)? > > > * In respect to tutorial, what does the attribute path="/stockPrices" > > in <servlet> xml tag mean and the identical annotation > > @RemoteServiceRelativePath("stockPrices") in service interface? I > > assume that the server-side method gets called when under that url, > > but how is the client aware of the mapping? > > > * So far I have only seen tutorials on implementing relatively easy > > projects. Does anyone know if there a more powerful sample application > > with open source available: something where there is a need for more > > than one html-page and controller exist? > > It seems you're missing a pretty fundamental difference between GWT > apps and apps built with almost any other major web platform: with GWT > it's all client side. > > Now, nothing's ever as simple as that, but it's a good first > approximation in this case. With server-side frameworks like anything > that depends on PHP, Ruby, Python, Perl, or Java (besides GWT), > there's comparitively little in the way of smarts on the client side. > With GWT, you can build an entire app that has absolutely zero smarts > on the server side. > > If you want to build a client app in GWT that interacts with a RESTful > server, you can definitely map client-side events to URLs, but that's > not the only way to do things with GWT. You can put all your business > logic on the client, you can access server-side business logic with > GWT-RPC or other RPC-over-HTTP mechanisms, or you can strike a balance > and split the business logic across both client and server. One > advantage of GWT is that, with GWT-RPC and a Java-language > server-side, you can encode business logic in a set of Java classes > and run the same code on both the client and the server (with the > caveat that you have to limit yourself to those parts of the JRE that > GWT supports). > > As far as examples go, you probably want to look at the other example > apps in the GWT documentation. If I remember right, the mail app is > pretty comprehensive, and the doc for GWT-RPC is pretty good, too. > There's also a frequent poster on this list with an entire site > dedicated to GWT example code. I can't remember his name right now, > but his website is "roughian", or something like that. His name might > also be Ian, as a matter of fact. Anyway, search the list's history > for examples and I'm sure you'll find it. > > Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
