Re: need suggestion on scalable blinking implementation
You could do it with a single timer then have your blinking components listen for a tick event that the timer would fire. On Tue, Mar 17, 2009 at 8:52 AM, denis56 denis.ergashb...@gmail.com wrote: His, if anyone could share experience with achieving blinking behavior for several items on a page? in my case there is a table being shown whose rows should have multiple blinking elements (labels and images). Each of the blinking elements has -its own- timeout value defined to stop blinking. The way I have achieved it now, is by creating a composite (see sample code below) that takes an image/label and adds a timer to it. I am afraid that that is not a right approach as the table is constantly being updated to add/delete rows with new blinking components. That would lead to multiple timers being instantiated and started with .scheduleRepeating(XXX); method again and again without page being reloaded (the page should stay open for a day and display changing information). Could anyone comment on my approach: is it memory-leak and performance degradation prone? What would be a feasible alternative? maybe using external library like prototype? Many thanks, denis public class BlinkingCorner extends Composite { private boolean visible; private int blinkingTime = 5000; private long timeBlinkingStarted; public BlinkingCorner(final Image img) { timeBlinkingStarted = System.currentTimeMillis(); new Timer() { @Override public void run() { if (System.currentTimeMillis() = timeBlinkingStarted + blinkingTime) { img.setVisible(visible); GWT.log(visible= + visible, null); visible = !visible; } else { GWT.log(cancel, null); img.setVisible(false); cancel(); } } }.scheduleRepeating(500); initWidget(img); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Portable project structure?
The GWT plugin for Maven makes things like the location of the GWT compiler standard, it downloads the assembly to a local repository where Maven stores everything. Since you need Maven to build the project and it already knows where it put the GWT assembly it makes things easy, you could even have several versions available if you needed and all you would have to do is change the dependecies version and Maven would know where it was. You also get the default project with the Maven archetype which makes it easy to check out and see if it's something you could use. If you go with ant you could use Ivy in a similar way but it would need to be configured to add items in the repository to the classpath, it doesn't quite get this done right out of the box but would be more flexible if you absolutly need that. On Tue, Mar 3, 2009 at 3:19 PM, Sumit Chandel sumitchan...@google.comwrote: t, build targets are defined in your build.xml file. These contain targets --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Apps on Android!
The Android SDK and GWT have a lot in common as far as design and code styles. There are a couple of web servers available for Android that would let you serve up a webpage with GWT embeded in it but that would be a very round about way of getting things done. On Tue, Feb 17, 2009 at 2:02 PM, frankCostello smar...@gmail.com wrote: Hi, I want to make a Gwt application on Android! It's possible? How do I do? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Newline characters?
Try br / You'll probably have to tell it not to escape html/xml though. On Thu, Feb 12, 2009 at 7:02 PM, Soren Johnson soren.john...@gmail.comwrote: I am trying to use newline characters inside of Labels, but it only seems to work in the hosted mode. (Doesn't work in FireFox, for example) in other words, 'new Label(This is Line1\nThis is Line2\nThis is Line3)' doesn't seem to work. Any idea how I can get this to work? thanks... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT FileUpload
It should be servlet-mapping servlet-nameGameService/servlet-name url-pattern/GameService/url-pattern /servlet-mapping On Wed, Feb 11, 2009 at 12:45 PM, ken.d...@googlemail.com ken.d...@googlemail.com wrote: Thanks I found somthing useful, but one thing doesn't work for me: My Servlet: org.itech.server.games.GameService I wrote the following to the web.xml of my apache tomcat (like in the example): servlet servlet-nameGameService/servlet-name servlet-classorg.itech.server.games.GameService/servlet- class /servlet servlet-mapping servlet-nameGameService/servlet-name url-pattern*/GameService/url-pattern /servlet-mapping The path to the class file is correct, but I get the following error message: [WARN] Parse error in default web.xml org.xml.sax.SAXParseException: Error at (577, 23: Invalid url- pattern */GameService in servlet mapping [...] Can someone help me ? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Setting Up GWT Project in a Subversion Repository Question
You may want to drop Ant and go to Maven. It solves a lot of configuration problems like this for you. There is also a gwt plugin ( http://code.google.com/p/gwt-maven/) and I believe there is a base project so you don't really need to run the application creator script. It is also fairly simple to add Maven support to an existing project. On Tue, Feb 10, 2009 at 8:27 AM, Arthur Kalmenson arthur.k...@gmail.comwrote: There's a -eclipse flag you can give to the projectCreator and applicationCreator scripts that'll generate an Eclipse launch file letting you launch hosted mode from Eclipse. -- Arthur Kalmenson On Mon, Feb 9, 2009 at 8:43 PM, Superman859 russ.d.hollo...@gmail.com wrote: I'm just getting started with both GWT and Subversion, and ran into a question that I'm hoping some of you may know the answer to. I have set up a Subversion repository, and am able to check files in / out without issue. However, I think when I imported the project, that I either did something wrong or left something out. In Eclipse (using Subclipse) I checked out the project and noticed that none of the import statements for gwt were working. Furthermore, compile / shell scripts do not work either. I assume this is because when a project is created using projectCreator and applicationCreator, these are specific to the machine it is on or something. I originally created a new project and simply uploaded the whole project (all files, including the created .project, shell, compile, etc files) to the in a trunk folder. But it seems it isn't this simple, as when you check the files out, the gwt library isn't found (perhaps because it is in a different location on a different machine) and the scripts do not work. Can someone please provide a quick overrun of the process needed to set up a new project (I know how to use applicationCreator and projectCreator), add it to a repository (I know how to use Subversion and import and all that, just not sure which files), and any additional steps that will need to be taken on machines to be able to have a working copy in Eclipse in order to have the libraries found and able to use gwt-shell and gwt-compile for testing? A brief overrun would be very helpful - I know how to do the individual steps such as using Subversion and creating a new GWT project and using Subclipse, but I'm just not sure of the process needed to put it all together. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT FileUpload
I think the apache commons file upload project is usually used. http://commons.apache.org/fileupload/using.html On Tue, Feb 10, 2009 at 4:08 PM, ken.d...@googlemail.com ken.d...@googlemail.com wrote: Hi guys, i've got some trouble with FormPanel and FileUpload. On the client side I would like to provide a possibility to upload .jar files. But the thing I don't understand: How can I send this .jar file to my server? Is there any possibility to send a file to a servlet on server side or what are my options? My current code fragment looks like the follows: final FormPanel form = new FormPanel(); form.setAction(/uploadHandler); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); visualComponent.add(new FileUpload()); // Add an event handler to the form. form.addFormHandler(new FormHandler() { public void onSubmit(FormSubmitEvent event) { } public void onSubmitComplete(FormSubmitCompleteEvent event) { } }); I would be very glad if anybody can help me. Thanks. kdahm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT with webservices
JAX-WS can be used. If you've been using Axis you'll probably find it a lot easier. 2009/2/7 chandrajeet chandraj...@gmail.com Hi All, I didn't find yet a clean way to use webservices and GWT. I am using axis and it generates many Axis objects which aren't recognized by GWT as they are not POJOs. So, I am manually creating a new set of POJOs from those axis objects in the GWT client package. Is there any straight forward way to use the webservices without using Axis so that GWT(server code) can make webservice calls? Thanks in Advance, Chandrajeet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Problem with Generics and Serialization of Primitive Type Array Fields
Primitives do not extend Object and cannot implement Serializable. You should use the Object versions of primitives (i.e. use Integer instead of int) I don't think the code would even compile if you tried to use a primitive with generics. On Fri, Feb 6, 2009 at 4:25 PM, jsegal jason.se...@issinc.com wrote: I've been having some trouble with using arrays of primitive type where an array of type Serializable is expected. I have an object similar to: class MySerializableObjectT extends Serializable implements Serializable { private Serializable serializableField; void MySerializableObject(T value) { serializableField= value; } T getField(T value) { return serializableField; } } All of these cases can be serialized and deserialized successfully: - new MySerializableObjectSerializable(new Integer(0)); - new MySerializableObjectSerializable(1); - new MySerializableObjectSerializable(true); - new MySerializableObjectSerializable(Test); These cases case produces an exception when deserialized (Note that these will *not* cause a class cast exception as seen in http://code.google.com/p/google-web-toolkit/issues/detail?id=1822, although an array of non-primitive type will cause it): - new MySerializableObject(Serializable)((Serializable)new int[0]); - new MySerializableObjectint[](new int[0]); The exception's message is: com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type '[I' was not included in the set of types which can be deserialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be deserialized. The exception goes way if I add this type to my project, even if I don't actually create an instance of it anywhere: class MySerializableIntArrayObject extends MySerializableObjectInt[] { } I'm aware that the GWT compiler has to identify sub-types that can be used with parameterized serializable objects during compilation in order to build its serialization mechanism for those objects. I'm guessing this problem means that arrays of primitive types are not taken into account when it enumerates subtypes of Serializable, despite the fact that they are effectively subtypes of Serializable. If I'm correct, what is the proper way to fix this? I suppose it's possible to create fixed-type objects like MySerializableIntArrayObject for all primitives, but I'd like to avoid that (especially since I would end up having to do that for any other typed serializable objects I add in the future). If I understand the typeArgs annotation, using it would actually restrict the set of values I can use with this object, not add to the set (I can enumerate the primitive array types easily enough, but not all the other types that may be passed). If I'm not correct about the cause of the problem, I'd appreciate it if someone could explain it and suggest an appropriate remedy. Thanks, -jsegal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Help with GWT
You may want to look at antlr On Thu, Feb 5, 2009 at 1:39 PM, samurai.monk1 samurai.monk2...@gmail.comwrote: I am working in a port of a very large Java application to PHP. The required path was to modify the Java2Javascript compiler to produce PHP code instead of JavaScript. Right now I have found: JavaToJavaScriptCompiler: I understand that this is the main class. JavaToJavaScriptMap.java: My hope was to see the actual map of java keywords etc to the javascript equivalents. In other words I am confused. If you could help me to: 1. Find the relevant classes for building and stand alone java to javascript translator. 2. Is there a stand alone version that only takes a java project (or file) and just output the JavaScript file? 3. Can the GWT save the java AST to a file? Note: I understand this is not a PHP forum, so the PHP problem is mine. The questions refers to stage one: understanding and compiling a clean Java to Javascript translators. Really tank you in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: any tips for beautify gwt applications?
Wicket does work well with GWT, no need to drop one for the other. On Tue, Feb 3, 2009 at 8:04 AM, Alex dP (Violet UML Editor, WebVNC...) alexandre.de.pelleg...@gmail.com wrote: Another suggestion: migrate your project to Apache Wicket and give your web page template to a real web designer... Sorry for this suggestion but I know that having a beautiful GWT app is hard and it's probably not your job to spend time with CSS. By the way, don't hesitate to try Wicket and your life will be easier. On Feb 2, 11:54 am, jake H pnosti...@gmail.com wrote: Hello, I m close to finish a gwt application project that i have started a month ago. I m really delightful for gwt features and the time needed this project to be done. I used the simple widgets of gwt like tabpanels, buttons, lists, flextable. But the result seems to be like a simple HTML page. So i m asking if there are any designing tips to beautify my application , so it wouldn't be like a simple HTML page but a nice GWT application.( with 'wake effect' and etc ) Ty. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Threaded Servlet
Google didn't write the servlet spec, all servlet containers follow the spec sun wrote. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServlet.html On Thu, Jan 29, 2009 at 5:25 AM, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: Cant find that anywhere. Can you post a link please On Jan 28, 2:06 pm, Ben Tilford bentilf...@gmail.com wrote: From the documentation Servlets typically run on multithreaded servers, so be aware that a servlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections. See theJava Tutorial on Multithreaded Programming http://java.sun.com/Series/Tutorial/java/threads/multithreaded.html for more information on handling multiple threads in a Java program. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/H... On Wed, Jan 28, 2009 at 8:17 AM, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: My appologies jason, you were correct. I totally forgot about max connections per browser. So it would appear that my servlet is multi theaded after all and as a result, not thread safe :) Maybe this should be added to the GWT docs as this is something that i feel could be very easily overlooked. On Jan 28, 6:25 am, Jason Morris lem...@gmail.com wrote: I tried reproducing your test to see what you were getting. I found the behavior when I ran the code in Hosted Mode and executed serverMethod() /twice/ before executing anotherMethod() (it didn't matter how many Hosted Browsers I had open). When running the same test in real browsers (I used Firefox and Konqueror) the behavior was substantially different. Like I said, browsers generally only allow for 2 open connections per server. If you invoke a connection hogging method twice, you have no more connections to invoke a different method. That said, this is a strictly client side issue, GWT's RemoteServiceServlet is not limiting you to a single Thread. Try the same test with a normal HttpServlet and a RequestBuilder, you'll see the same results as you do with RPC. stephen.sm...@paretopartners.com wrote: @shawn Thats ok :) @jason Well these Tests are very basic. i create an app with a simple rpc call to the server that does something like this: public boolean serverMethod() { for (;;) { if (false) { break; } } return true; } public boolean anotherMethod() { return true; } As you would expect, callingserverMethod() creates an infinite loop tying up that thread. then i opened up a second, seperate browser and called anotherMethod (). result: Nothing. Not a sausage :) So id say my results are pretty solid. 1 single lonely thread :( On Jan 27, 3:17 pm, Shawn Pearce s...@google.com wrote: On Tue, Jan 27, 2009 at 01:42, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: I never said it cretaed multiple instances, simply a new thread per request. *sigh*. I must not have had enough coffee in the morning before replying to your post. I read thread as instance in your original post. Sorry. On Jan 23, 4:30 pm, Shawn Pearce s...@google.com wrote: On Fri, Jan 23, 2009 at 08:17, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: Standard servlets create a new thread per request but from a few simple test i have run this appears not to be the case with GWT. Like what everyone else has already said; each concurrent request runs on its own thread, but that thread isn't necessarily new. Most containers recycle threads as thread spin-up/shutdown are relatively expensive operations. Pooling threads and recycling them across requests reduces the per-request overheads imposed by the container, allowing applications to use a larger percentage of the CPU, and the per-request latency target the developer is shooting for. E.g. in my latest GWT based application, I was trying to hit 200 ms latency. The more of that time that is available to the application, the more useful work I can do within that window.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr
Re: Microsoft Picture Manager
You would need to write your own javascript library and most likely a browser plugin to be able to do something like that. Browsers intentionally prevent you from doing this sort of thing. On Thu, Jan 29, 2009 at 11:00 AM, Anti zer...@gmail.com wrote: Mmmm So things related to Javascript and HTML have nothing to do with GWT? I don't think so. I insist, how do I open a, for example MS Word, from a GWT instruction? Thanks. On Jan 29, 7:26 am, Arthur Kalmenson arthur.k...@gmail.com wrote: Then this question has nothing to do with GWT. You're going to have to ask on another forum how you would open Microsoft Picture Manager using Javascript and HTML. -- Arthur Kalmenson On Wed, Jan 28, 2009 at 11:02 PM, Anti zer...@gmail.com wrote: That's not the problem. The problem is: how to open the local, external application in the client side? On Jan 28, 9:11 pm, Arthur Kalmenson arthur.k...@gmail.com wrote: I'm not exactly sure how it works through HTML and Javascript. If it's just a hyperlink, then you can make the same hyperlink in GWT using the Hyperlink widget. -- Arthur Kalmenson On Wed, Jan 28, 2009 at 10:05 PM, Anti zer...@gmail.com wrote: Anyway as long as it can be done with gwt. Thanks. On Jan 28, 8:47 pm, Arthur Kalmenson arthur.k...@gmail.com wrote: How would you do this through regular HTML and Javascript? -- Arthur Kalmenson On Wed, Jan 28, 2009 at 1:02 PM, Anti zer...@gmail.com wrote: Hello, Is it possible to execute Microsoft Picture Manager through a gwt Hyperlink? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Threaded Servlet
From the documentation Servlets typically run on multithreaded servers, so be aware that a servlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections. See theJava Tutorial on Multithreaded Programminghttp://java.sun.com/Series/Tutorial/java/threads/multithreaded.html for more information on handling multiple threads in a Java program. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServlet.html On Wed, Jan 28, 2009 at 8:17 AM, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: My appologies jason, you were correct. I totally forgot about max connections per browser. So it would appear that my servlet is multi theaded after all and as a result, not thread safe :) Maybe this should be added to the GWT docs as this is something that i feel could be very easily overlooked. On Jan 28, 6:25 am, Jason Morris lem...@gmail.com wrote: I tried reproducing your test to see what you were getting. I found the behavior when I ran the code in Hosted Mode and executed serverMethod() /twice/ before executing anotherMethod() (it didn't matter how many Hosted Browsers I had open). When running the same test in real browsers (I used Firefox and Konqueror) the behavior was substantially different. Like I said, browsers generally only allow for 2 open connections per server. If you invoke a connection hogging method twice, you have no more connections to invoke a different method. That said, this is a strictly client side issue, GWT's RemoteServiceServlet is not limiting you to a single Thread. Try the same test with a normal HttpServlet and a RequestBuilder, you'll see the same results as you do with RPC. stephen.sm...@paretopartners.com wrote: @shawn Thats ok :) @jason Well these Tests are very basic. i create an app with a simple rpc call to the server that does something like this: public boolean serverMethod() { for (;;) { if (false) { break; } } return true; } public boolean anotherMethod() { return true; } As you would expect, callingserverMethod() creates an infinite loop tying up that thread. then i opened up a second, seperate browser and called anotherMethod (). result: Nothing. Not a sausage :) So id say my results are pretty solid. 1 single lonely thread :( On Jan 27, 3:17 pm, Shawn Pearce s...@google.com wrote: On Tue, Jan 27, 2009 at 01:42, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: I never said it cretaed multiple instances, simply a new thread per request. *sigh*. I must not have had enough coffee in the morning before replying to your post. I read thread as instance in your original post. Sorry. On Jan 23, 4:30 pm, Shawn Pearce s...@google.com wrote: On Fri, Jan 23, 2009 at 08:17, stephen.sm...@paretopartners.com stephen.sm...@paretopartners.com wrote: Standard servlets create a new thread per request but from a few simple test i have run this appears not to be the case with GWT. Like what everyone else has already said; each concurrent request runs on its own thread, but that thread isn't necessarily new. Most containers recycle threads as thread spin-up/shutdown are relatively expensive operations. Pooling threads and recycling them across requests reduces the per-request overheads imposed by the container, allowing applications to use a larger percentage of the CPU, and the per-request latency target the developer is shooting for. E.g. in my latest GWT based application, I was trying to hit 200 ms latency. The more of that time that is available to the application, the more useful work I can do within that window.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: what design pattern to use with DWT
The controller in GWT should for most cases use the observer pattern, your model should support property change events and registering listeners. This gets around the action way of implementing a controller and is quite a bit more flexible since you could have multiple listeners for a single event. If your not already familiar with listeners you may want to look at some Swing applications since GWT and Swing both use the same Property Change Support mechanisms. Also GWT In Practice has some pretty good examples of how GWT is intended to be used in terms of an MVC approach if your interested in a book on the subject. On Wed, Jan 28, 2009 at 1:17 PM, gregor greg.power...@googlemail.comwrote: I would not get too hung up on the Controller part of MVC. I don't know php, but it sounds the same as struts: cycles of pages (views) rendered to client driven by action classes (controllers) that both use a model (beans in Java speak). These action classes that drive generation of the next view fit beautifully into MVC pattern as controllers, but in a GWT application there is no need of them because this work can be done on either the client or the server as appropriate for the use case, and in general the more on the client the better (keep as much state as possible on client). Therefore exactly what a controller is in a GWT application is IMO a slippery concept. I would recommend two things: 1) If you are starting a new project download 1.6 from trunk to take advantage of the new Event model. It is much more powerful than the existing =1.5 event system. Unfortunately there is is little documentation for it yet (even the javadoc is sparse) but I'm sure questions about it would be answered here PDQ. Experimenting with this will help you determine how you might best design your client GUI, i.e. how your main components might best communicate between themselves and when necessary with the server. 2) In an ideal (MVC) world what Ian calls smarts should live in domain model classes, and these should flow freely across networks. As Ian points out this is sometimes possible and sometimes (perhaps most often) it isn't because we are dealing with a given technology stack that we can't alter in the short term. I don't think there is any one satisfactory answer to this question - every application has it's own use cases that will rub up against technology stack limitations in different ways. My point is that thinking about this (i.e. how to implement a domain model in a real world stack) is much more important than worrying about what a controller is. regards gregor On Jan 28, 4:35 pm, Jason Essington jason.essing...@gmail.com wrote: MVC is a good design pattern to use with GWT. If you are new to GWT, get Ryan Dewsbury's book Google Web Toolkit Applications it does a very good job of outlining exactly what is model, view and controller in each example project. -jason On Jan 28, 2009, at 9:10 AM, asdf_asdf wrote: His, 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? Many thanks, Denis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from