Is there a mechanism to dynamically load a GWT Module?
The idea is to create a pluggable GWT-based system: a core GWT module that dynamically loads another GWT module and a bus communication system to permit the communication through loaded modules.
Any help?
Possible duplicate of Web Application using OSGi and GWT
Also, see the information in this GWT User forum thread - http://groups.google.com/group/google-web-toolkit/msg/4a3f912cb89a7256
To summarize, its possible, but not recommended. Your requirement is orthogonal to GWT's philosophy and architecture. If you must, the GWT Exporter project is a useful starting point to enable communication between modules.
Code splitting does successfully handle the separated-loading issue -- but it does not address the separated-compilation issue.
Modular-interoperability with separated-compilation will never be the recommended default but GWT team should look into this in future.
If we are talking about a plug-in based architecture, different plug-in developer should develop their own UI and compile and give to the framework. Framework should dynamically load them.
I am still looking for and way to do it (do it better way).
You can use code splitting to dynamically loading the code when ever you want.
Have a look
http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html
See also comments at http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting, starting at 6th comment.
Related
I have existing project written in Zend Framework 1, it is long term project, constantly developed and without possibility of migrating to ZF2. It would be really neat to use Symfony2 Web Profiler bundle in it.
Currently, in development, I am using zfdebug (https://packagist.org/packages/spekkionu/zfdebug) which is great, but bundle from Symfony2 has so much more to offer...
I managed to incorporate Composer into my application (in Bootstrap), so loading something with it should be no problem. Also I found package on Packgaist (https://packagist.org/packages/symfony/web-profiler-bundle) but to be honest - I don't know if it is even usable without Symfony2.
Thanks for any tips.
No, this is not possible. If you take a look at the requirements on packagist you see it requires symfony/http-kernel, symfony/routing and symfony/twig-bridge to work. That's because the way the WebProfilerBundle works:
It registers himself at the most common events, the events happening in the HttpKernel and Routing component. If he cannot register to these events, he will not be able to give you timer information.
Moreover, it uses another event to inject imself in your page, meaning that if you don't have that event, you will never see the bar.
And the bundle is using Symfony conventions and techniques, meaning that it cannot run on ZF conventions and techniques. This is why it is called a Bundle instead of a Component, components are stand alone, bundles aren't.
I'm in the process of exposing some of the data generated in one OSGi bundle with a REST interface so it can be consumed with typical http requests afterwards by anyone. To do this I'm using a combination of apache-cxf, JAX-RS and Jetty (for testing purposes mostly).
My whole application is distributed in two ways:
Core: Runs a set of minimal bundles as an OSGi framework.
Full: Core + plus a set of plugins to be used within Eclipse, in a graphical way, to put it that way.
While in the Core launch configuration I can make this work without any problems, have a look at the MANIFEST:
Require-Bundle: cxf-dosgi-ri-singlebundle-distribution;bundle-version="1.3.1",org.eclipse.core.runtime, org.eclipse.osgi.services;bundle-version="3.3.0", org.mortbay.jetty.server;bundle-version="6.1.23", org.mortbay.jetty.util;bundle-version="6.1.23"
When I try to launch the Full distribution, jetty server does not seem to start and thus, the RESTful service is not working properly. Full distribution comes with a lot more plugins, mostly related with wizards, perspectives and so on. Root of this problem is somehow related with the cxf-dosgi-ri-singlebundle-distribution bundle, and can be tackled by "forcing" auto-start of this bundle to true, instead of default (check image below):
While this is OK, my question is ...why is this happening? And second and most important, I distribute the Full distribution via an update site, so users can download it, open perspective and start using it, that said, will this affect the final distribution? Is there a way I can control this auto-start=true for the apache-cxf bundle in the update site?
Hope I can make myself clear...
Thanks!
I don't like answering my own questions, but since I'm getting no feedback and maybe someone else has the same problem...here it goes
I decided to change the whole design of my restful bundle, by not using apache-cxf, since it is really not needed. All I need to do what I want is the embedded Jetty server and javax for dealing with HttpRequests and HttpResponses. Thus, I get rid of dependecies with third party libraries, leveraging the launching problems at the same time.
Got the ideas from these official sites in Eclipe:
Embedding an HTTP server in Equinox
Writing a bundle-based server application
Besides, a more hands-on tutorials can be also found here:
OSGi as a Web Server application
Extending Eclipse: displaying HTML content from a bundled archive
Special thanks to both authors for the enlightenment :).
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP.
I'm looking for people's opinions on the suitability of Google Web Toolkit for a brand new web app I'm developing.
A big requirement is that the UI is attractive and well designed (Does not look like a clunky Java/Swing App).
It should look like any typical HTML/CSS/JS based modern website.
It is an internal company application so no SEO is required.
JSF is not an option.
The web app frameworks used will be Spring Webflow and Spring MVC. It will use lightweight controllers to communicate with a service layer.
Would Spring Tiles combined with JSP be an easier or more flexible option than GWT for what I am trying to achieve?
Advantages/Disadvantages of GWT and other options welcome.
Thanks
Advantages of GWT
You don't really need to know any JavaScript, since all your client side code will be in Java
This is usually the main reason people go for GWT. They're backend developers who know Java but don't know Javascript, and they don't really want to learn it. Still, you should be careful about this. GWT is a very complete and complex framework with many concepts that are specific to GWT. Even though you'll be coding in Java you will still have to go through many tutorials and documentation before you can build a clean GWT app
Ready to use widgets, like date pickers, dynamic tables, layout panels, popups
It's not really specific to GWT. Other front end framework, like jQuery or Dojo or whatever also give you these. You can have a look at the GWT Showcase to see what GWT has to offer.
GWT takes care of a lot of complex and potentially dangerous stuff for you.
Stuff like Cross-Browser Support, Internationalization, Image and static resources bundling, Front end security, Ajax communication with a server, Events and MVP (just like MVC) framework support. Have a look at the documentation, it is very well done and very thorough.
Debugging is easy
GWT has two different 'modes'. When you're building your app for production, gwt will compile all the java code for the front-end that you wrote into javascript. This javascript will be executed in your clients' browsers. But when you're developping, you can run your app without compiling your java code to javascript. This lets you use a debugger to debug your interface. It's a very good tool.
Disadvantages of GWT
As I said before, GWT is a full framework, with concepts specific to it. Don't think that just because it's in java and you know java that you won't have to learn new stuff.
Interfacing GWT with back end frameworks is not easy
The most common way for your GWT client code to communicate with a server is by using GWT RPC mechanism. It means that you will need to have servlets that implement specific interfaces. You should definetly read the docs on client-server communication to see if that fits well with Spring. A search on SO or Google should give you pointers to setup your application.
We're planning on creating a feedreader as a windows desktop- and iPad application. As we want to be able to show Websites AND to run (our own) JavaScript in this application, we thought about delivering the application as HTML/CSS/JavaScript, just wrapped by some .NET control or a Cocoa Touch webbrowser component. So the task at hand is to find out which framework to use to create the HTML/CSS/JS files to embed in the application.
For the development of the HTML/CSS/JavaScript we would be happy to use Vaadin, GWT, or some other framework, as we're a lot better with Java than with JS. We favor Vaadin after a short brainstorming, as the UI components are very nice, but I fear that most of the heavy lifting will be on the server and not in the client (and that wouldn't be too nice). We would also like GWT, but the Java-to-JS compiling takes a lot of time and an extra step, and slowed down development time in the past when using it.
The question is: which development framework would you choose (given you wanted to implement this project and you mostly did Java so far) and why? If there are better framework options (List of Rich Client Frameworks), please let me know.
Edit: The application will need to talk to our server from time to time (sync what has been read for example), but mainly should get the xml feeds itself. Therefore I hope that most of the generated code can be embedded in the application and there doesn't need to be heavy activity with our server.
Edit2: We (realistically even if you doubt) expect at least 10000 users.
Based on my experience with Vaadin, I'd go for that, but your requirements are somewhat favoring pure-GWT instead.
Vaadin needs the server and server connection. If building mostly offline desktop application, this can be solved with an embedded Jetty for example. (synchronize with an online service only when needed), but for iPad you would need to connect online right away to start the Vaadin application.
GWT runs completely at the client-side and you can build a JavaScript browser application that only connects when needed.
Because Vaadin is much quicker to develop, you could build a small Vaadin version first and see if that is actually problem on the iPad.
On the other hand, if you can assume going online right away, you can skip the local server installation altogether. Just run the application online and implement the desktop version using operating systems default browser control (i.e. the .NET control you suggested). Then Vaadin is easier.
Vaadin is just framework base on GWT but have two very important features:
don't need to run GWT compiler. It is pure java. Of course if not add addons because then gwt compiler must run.
you don't need to write communication code. So you don't need to solve DTO problems, non-serializable object mappings and dont need to write servlets.
I use Vaadin in my work for one year and we haven't performance problems yet (desktop like application with ~500 users). IMO very good solution is to use Vaadin just for UI, logic move to independent beans and connect this two elements using Spring or Guice.
In this case you should use MVP pattern and Domain Driven Development.
Bussines beans is domain objects and logic that use view interfaces to send responses.
Custom Vaadin components (could extends standard components) implements view interfaces.
That way is good when you decide to change UI engine if Vaadin is not for you. Just rewrite guice/spring mappings and write new implementations of view interfaces.
My 3 cents:
If you decide to use vaadin, You will benefit from already GOOD LOOKING components. Since you dont want to write (alot of) CSS , vaadin is already good looking out of the box. How ever, Vaadin is a SERVERSIDE framework. User interface interactions will hit the back end even if they dont involve getting any data (e.g moving from one tab to the other) .
If you decide to use GWT, you will have to atleast style the application (this is not hard) . There is also the problem of long compilation time (but you can test and debug on hosted mode which allows you to run the application without compiling , then you compile only when deploying). The main advantage of gwt is that you control what gets sent to the wire, For UI interactions that dont require getting data from the backend, it will work purely on the client side. You the developer will determine when to send a request to the back end. (Doing RPC requests in GWT is very easy)
Hope this will help you make the decision.
I am currently doing a project on GWT and in the background study, I need to perform research on GWT. I have included many things which I will list below. Can anyone point out something that I may be missing or what other interesting thing concerning GWT I can include? The following is a list of all the topics that are currently included:
GWT Java to JavaScript Compiler
Deferred Binding
JSNI (JavaScript Native Interface)
JRE Emulation Library
GWT-I18N (Internationalization and Configuration tools)
GWT’s XMLParser
Widgets and Panels
Custom Composite Widget
Event and Listeners
Styling through CSS
GWT History Management
GWT Hibernate Integration (through GLead)
MVP (Model-View-Presenter) for GWT through Model View Presenter Application
Controller and Event Bus
Server Calls using RPC and request builder
Comet
Serialization in GWT
JSON (JavaScript Object Notation)
Testing Web Application with GWT
JUnit Benchmarking Selenium
Further work in GWT such as Ext-GWT and smart GWT
Here my additions may be helpful to you
GWT Logging
Editors
Speed Tracer
RequestFactory
GWT animation
Formatter (NumberFormat, DateFormat)
one of the most important things
GWT <-> GAE(Google App Engine)
and last (you forgot)
GWT modules :)
I am not sure if it is implicitly included in one of the points you listed but :
Client Bundle
The resources in a deployed GWT
application can be roughly categorized
into resources to never cache
(.nocache.js), to cache forever
(.cache.html), and everything else
(myapp.css). The ClientBundle
interface moves entries from the
everything-else category into the
cache-forever category.
You may want to take a look into UiBinder and RequestFactory as well as some of the development and testing tools such as GWT Designer and Speed Tracer.
If you are planning to use Spring , on server side, you should consider gwt-spring integration.
although, gwt designers do not provide reflection and recommend not to use the reflection, using reflection is inevitable, and if you use carefully, its cost is bearable..