Have you tried using MVC or any other UI pattern for GWT client code. What are the pitfalls/advantages you’ve faced in different approaches?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you need to treat GWT just like any other UI framework, like Swing, Cocoa, etc. Everything that makes sense in those frameworks in terms of MVC (or other paradigms) makes sense in GWT as well. I think sometimes people take the MVC thing too far, and I like the way it works in Cocoa more than most frameworks. You create a view, you have a ViewController that controls all the behaviour of the view, and then you have model objects with all your data. I don’t think you need to be dogmatic about where all of your business logic is, it just needs to be where it makes sense.
In terms of pitfalls,the main one you will run into is that GWT is purely a front end technology, so technically the back end is sitting on a server somewhere. I don’t see this as being that different to writing a client server swing application, that stores it’s data in the cloud somewhere. The difference is that GWT is compiled down into javascript, and has all the limitations of a javascript web application, so there will be some things that you simply cannot do on the front end. Let’s say for example you want to create a PDF and show that to the user, you can’t do that in GWT, you need to call the back end to do it for you. In a Swing app on the other hand you could probably use itext and do it on the client side.