0

I am planing to rewrite my desktop finance application (written in Delphi) as web application and am thinking which technology to use. Other possible requirement is to transfer as much code as possible to shared library which could be used in desktop version of the application too. There is no such parameter as total cost of owhership. I can rewrite it as long as I want.

I need a cross-platform technology which is able to handle UTF-8 natively and connect to PostgreSQL as well as Microsoft SQL Server.

I have programmed enough with Ruby on Rails and will say that it is quite good for commercial websites but does not fit for my own web application, as I do not like its "magic" and inability to write .rb files in UTF-8.

PHP seems to be similar to RoR although I haven't tried it.

ASP.NET / .NET MVC meets my requirements except it is for Windows only.

So, I've chosen Java. But they say in Internet that Java and JSP are different technologies and I can not take Java desktop application and with very little changes convert it to JSP. Are Java and JSP really so different? For example, in .NET I could write a database- and business-logic-library which could be used in desktop application as well as in ASP.NET application.

Paul
  • 25,812
  • 38
  • 124
  • 247
  • 3
    JSP is not comparable to ASP.NET(MVC). ASP.NET(MVC) is comparable to JSF (and EJB/JPA for business/DB logic). Related: http://stackoverflow.com/questions/2556553/what-is-the-main-stream-java-alternative-to-asp-net-php – BalusC Oct 14 '12 at 15:14
  • there is no problem with UTF-8 in Ruby. And for the record PHP is nothing like Ruby. – Andreas Oct 14 '12 at 15:52
  • BalusC, I would choose your answer as the best one. – Paul Oct 14 '12 at 19:36

3 Answers3

1

Java and JSPs are not different. JSP gets compiled into Java Servlet before execution.

JSP is meant for writing HTML/ASP like code dealing with presentation. In other words, it gives segregates presentation detail from Java coding, but in the end, server compiles your JSP files into Java Servlets.

What you want to write in JSP, can be written through Servlet.

If you plan to use JSP over Servlet, please make sure you are not writing entire code in JSP itself e.g. reading data from database. All the business logic should go in JAVA classes and used in JSP through your JAVA classes. Your Java classes can be reused if designed appropriately.

If I understand you right, this is what you are trying to achieve i.e. achieve re-usability of your application logic.

Yogendra Singh
  • 33,927
  • 6
  • 63
  • 73
1

They are not that different besides you can reuse your services, logic etc. in the same way .NET does it. The only problem is the view, there are many ways of doing it in java. If you've chosen JSP you will need to code all your presentation (you can invoke your services, logic, etc.), but if you want reuse as much code as possible in a Desktop java application an take it to the web perhaps your should take a look at java Applets which are relatively simple to turn into a java application.

PbxMan
  • 7,525
  • 1
  • 36
  • 40
1

For the situation that you describe it should be pretty easy to have a lot of shared code for both the desktop and the web application.Think of the application as consisting of 2 layers:

  • Layer 1: Business logic and Database access code, this layer just pure java it should not depend on any technology that can not run outside the container. For example, you can use JPA for database access, and Spring to organize your business logic into nice modular units. If you write a comprehensive test suite for this layer, then you would have confidence that your business logic works correctly and it would it make it easier to figure out if a bug is a web app bug or a desktop bug.
  • Layer 2: UI logic, you will need two instances of this layer, one written using a desktop UI technology like Swing,or JavaFX and another layer UI layer written in a Web application programming technology such as JSP / Servlets, JSF, SpringMVC, .... etc. This UI layer will depend on the Layer 1 and because of the comprehensive test suite for layer 1 you can be confident that the operations it calls upon on layer 1 are good.

As far as web development technology I would recommend that you consider higher level frameworks that JSP and Servlets, because that will save you a lot of time.

There is a possibility to be able to write a single UI layer using JavaScript, HTML 5 which is a web app but behaves like a desktop app for many features. You can then make a desktop version of your product that basically launches a browser windows without the chrome and runs the app within it. If you do choose to go down this road of using JavaScript and HTML 5 there are plenty of frameworks to choose from, I would recommend that you watch the videos on infoq.com from the ThroneOfJS conference http://www.infoq.com/throne_of_js/ to get an idea of what frameworks are available my biased recommendation would be for using AngularJS.

ams
  • 60,316
  • 68
  • 200
  • 288