views:

70

answers:

1

Hi there, this question is a extension of one made in http://stackoverflow.com/questions/3782849/best-solution-architecture, basically i want to know what is the best architecture to deal with a solutions where both desktop and mobile applications are involved. in this time i would like to know, what if we decided to go over java technologies, how can we build this solution in order to reuse as much code as possible.

Solutions must run over a windows,linux and mac machines ( we know that using java and swing tech as business and GUI respectively , we can accomplish this requeriment). the problem comes when we decided to incorporate Android OS for mobile capability of our solutions, how can we reuse the code written for desktop application ? how can expose my business class as a service when we are trying to avoid web or application servers installations ?. is it possible to archive SOA avoiding web o application server ? what are the best developing techniques in order to reuse as much code as possible ?.

If you guy has any documention or any comments which point me in right direction to solve this problem i'd appriciate it.

+1  A: 

If you are trying to avoid hosting a web server with the code running on it then I would suggest creating good old fashion JAR library.

Keep all the user interface code out of the JAR and just program the business logic as an API. Code it in J2SE 1.5, but make sure you test it both on the desktop and mobile environments. Then you can use your business-logic JAR file when it is time to create the complete desktop app and Android app.

For information on using JAR files in Android this should help: http://stackoverflow.com/questions/3217643/how-to-add-external-jar-libraries-to-an-android-project-from-the-command-line

For information on JAR files in general and for desktop applications read more here: http://java.sun.com/developer/Books/javaprogramming/JAR/basics/

satur9nine