javagwtmvpgwt-mvpgwt-places

Getting rid of GWT MVP boilerplate


Following the documentation on places & activities + MVP, for each page I have to create:

I created an app with basic functionality(5 pages and a navbar) and I already have more than 1500 lines of code and ~40 files. I think this is completely unmaintainable, however I haven't found anything on solving this. There are a couple of frameworks(eg GWTP) which implement MVP but they need the same amount of boilerplate as well.

I could achieve the same functionality in ~200 lines using spring mvc or play.

What am I doing wrong and how would you solve it?


Solution

  • I think this is completely unmaintainable

    I do not agree with you. Large number of small files is much better for maintenance than couple large files. I agree that GWT is much more verbose than Spring MVC:

    In a case of GWT due to strict nature of Java and statefull view you must do a lot of additional work. It is completely maintenable (if it is done correctly). Main advantage is that you can add unit tests for your presentation layer. Due to this fact it will be more maintenable for long running projects with complex UI, large codebase and big team. If it is not the case for you project (screens are simple and you do not plan to add unit tests for UI layer) then it may be better to:

    Two another advantages of interfaces between view and presenters:

    What is really annoing with all these files is that it takes much time to setup one activity. To simplify it:

    Another source of boilerplate is data binding. Consider using editor framework.