Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Tom Newsgroups: comp.lang.java.programmer Subject: Re: Support for both Web and Desktop front-ends [Architecture] Date: Wed, 13 Jul 2011 10:34:08 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 51 Message-ID: References: NNTP-Posting-Host: kyiEPMrZYa1k6vhLW1G2ZQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Pan/0.133 (House of Butterflies) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6157 On Wed, 13 Jul 2011 11:41:40 +0800, Warren Tang wrote: > I'm about to develop an application which needs to support both Web > client and desktop client. Is there any existing tools/practices I can > use? Or any suggestions? > > Recently I've done a project with Google Web Toolkit(GWT) + myBatis. > Newly shifted from .NET Framework to Java, my current knowledge set is > limited to core java, no Java EE or Spring experience (though I have > plans to learn them).So lightweight is preferred. > > Maybe I can use GWT + Spring + myBatis? For the desktop front-end I > should use Swing + Spring + MyBatis? The Spring MVC can handle the two > front-ends and make sharing business logic easier? The issue is you need client and server (where these terms are used in their general sense) that are agnostic of one another yet support both web/desktop. In our products we started with desktop apps but now we want web versions too. You don't say what your desktop platform would be but as you've posted in the Java group..... we developed our own server implementation and c/s architecture for (desktop) clients. We jettisoned the whole idea of object-relational mapping and indeed anything to do with /implementing the application/ using OO, preferring to regard all data as just a tree. After all, this is what the document object model is so why introduce all the OO noise? Anyway, our desktop client is swing and uses serialisation to/from the server. There is no soap/rmi, just sockets. Events are both ways so the client is sync'd as the server sees fit. Because all data is just trees, MVC with the desktop is automatic (you don't have to code that). We have transactions, locking and so forth. When we came to consider web front ends, our data model lends itself to the generation of json so we wrote a simple servlet that processes service requests from the browser and generates the tree in that form (rather than serialising it to the desktop client as it would normally). We looked around for a suitable browser framework and chose qooxdoo: http://manual.qooxdoo.org/1.4/pages/introduction/about.html (Its not html/css etc so not sure if that is the sort of web client you want) This means that we can use the same server-side code for both types of client (with a little use of modularisation). Deep link: http://www.inqwell.com/examples/petstore/myorders.html#serverstruct The qooxdoo/javascript integration work we have to do is still in progress but we've got trees/tables etc working and we're free of J2EE/JPA/Hibernate etc, which we don't want.