2

So GWT best practices encourages one to use some flavour of MVP, which should in theory allow one to write different native views while sharing the presenter business logic.

This seems to be at the heart of the GWT spin off Google project http://code.google.com/p/j2objc/ which converts the non-UI part of your code to Objective-C, allowing you to write the rest natively in Objective-C.

So my question is: If this really hard part of the puzzle is being solved, how hard would it be to include an HTML5 mobile library (like MGWT or Touch4j [Sencha]) into this MVP pipeline to have the best of all worlds?

Having dabbled with http://code.google.com/p/playn/ , this clearly seems to be the blue-print for having a cross-plaftform build system (native android & html5 & java &...), but that project is geared for single screen drawing and event loop for game dynamics and doesn't allow for keyboard input and other typical mobile goodies.

It seems a shame that if so much of the problem has been solved, that it's not possible to go the extra mile. The answer to this question would be the best plan for actioning a solution, including such nigglies as which MVP structure to choose that would ease accommodation of the various widget libraries (GWTP vs MVP 2.1), and if the best approach is to start with the PlayN code base, and start to hack it.. what are the gotchas? Or if another path is chosen, why that one? and why would it be the best??

Thanx a lot. :-)

Daniel Gerson
  • 2,159
  • 1
  • 19
  • 29
  • +1 for question. Can you also higlight your Objective C requiremetn in title as well as question. It will probably get broader attention. Also maybe tag it wil those technologies as well. There is a playn tag in stackoverflow. – appbootup Dec 05 '12 at 11:21
  • 1
    I've started writing a solution. Watch this space :-) – Daniel Gerson Feb 20 '13 at 13:52

2 Answers2

1

It is not clear whether your question is - evaluation options for multi-platform app development or mvp.

You can evaluate additional technology which are used with Sencha and GWT

1) mgwt 2) titanium 3) phonegap

You can also reference - Creating a mobile app using Google App Engine and GWT?

Note: PlayN as you mention is more of gaming platform and not suitable for business app.

Community
  • 1
  • 1
appbootup
  • 9,537
  • 3
  • 33
  • 65
  • I'm familiar with all the technologies you posted, except that AppCelerator (Titanium) is more for plain javascript and not clear it's easy to use it with GWT. I want a strategy for a single business code base that outputs BOTH Sencha/PhoneGap/MGWT on the one hand (as you mentioned)... BUT ALSO a pathway to output Objective-C & Native Android on the other. Please re-read the question. Take a look at j2objc and see how MVP is at the heart of it's multi-platform delivery strategy. – Daniel Gerson Dec 05 '12 at 10:51
  • Regarding leveraging PlayN. I realize that the eventloop in playN is not useable... BUT, the maven project structure is a great place to start, as by default it compiles an HTML5 version, and Android version, a Flash Version and vanila Java version (and even a beta Objective-C version). This build structure is exactly what I would like to leverage for general mobile app development... and throw away the gaming/canvas/sound parts. – Daniel Gerson Dec 05 '12 at 11:04
  • In essence you would likey be forking it out :) . Ground breaking if successful as google search does not turn out any solution like that. – appbootup Dec 05 '12 at 11:19
  • 1
    Thanx! I'm glad you get it now :-) I really like the idea, and it doesn't seem so so complicated, although there are issues. MVP is key, as playN by default is a java library that is used exactly the same way on all target platforms. Coming up with a single universal wxWindows widget style wrapper library is too hard and probably limited, so rather a one-code-base business logic strategy and rewriting "dumb" views seems achievable. Choosing the MVP specifics are key, because it must work on all target platforms (i.e. places/activities etc). – Daniel Gerson Dec 05 '12 at 11:43
0

MVP is definitely doable... and at times you may feel like its a lot of work, but it pays off in the end. Check out the Touch4j Kitchen Sink, which is written using MVP. You can take that down to the device with Cordova if you wish. The code is on GitHub:

https://github.com/emitrom/touch4jks

The repo is actively being worked on (we are updating ourselves to Touch4j 4.0) so it won't run out the gate, but at least you can see and follow the model :-)

Titanium4j is to Appcelerator's Titanium as Touch4j is to Sencha Touch. You may want to check that out as well. Titanium4j and Touch4j rely on GWT.

Cheers.

  • I'm going with GWTP's MVP model, because it supports code-splitting out the box, has simpler place management, supports hierarchical presenters and makes heavy use of dependency injection. Touch4j looks very similar to MGWT. Anyway, thanx for your input. – Daniel Gerson Feb 27 '13 at 21:18