views:

154

answers:

5

I have a crawler-like software that populates tables after reading and parsing particular web pages. I have written it in Java (using Hibernate). I already have entities and other logic.

I want to show these tables in a web page, the web page will improve eventually, there may be register/login screens, lots of other things.

My question is should I use a simple web framework written in language other than Java, like Django, or should I stick to Java and reuse those entities and logic that I already have?

If I use another language in I anticipate that I will need to duplicate some logic that I already have in Java part, which means bugs are more likely to occur.

The reason I am asking this, when I tried to write a simple web application in Java it was really hard using a framework, when I switched to another language, thus framework (CakePHP at the time), everything worked out smoothly.I think using a Java will over complicate things.

Right now I am thinking to separate view and the logic.

I will be glad if you show some pointers by sharing your experiences and ideas.

+6  A: 

Have you already had a look on Grails? I think it might be really good for you because you already have some parts of you application implemented in Java and the Groovy language can use all of it but makes web application frontend development way easier to handle and is extremely easy to learn if you are already familiar with Java.

What I think will be an overkill is to separate you application in a Java backend and a frontend written in another language. You will have quite an overhead that they can communicate which imho usually only makes sense in very distributed applications.

Daff
+1 for suggesting Grails. You will get 2 benefits by adapting Grails. 1. It is built on top of Spring. 2. It has seamless integration with Hibernate, in fact Hibernate is its answer for persistance.
Adeel Ansari
I will go for the Grail it seems
nimcap
+2  A: 

I would second Daff's suggestion here. But if you don't find yourself comfortable with Groovy, and its feels like learning another language to you, beside its easy to learn IMO. I would still suggest you to stick with Java, there is no problem with that. We got very nice easy to use web frameworks in the pool.

I would advise you to look at, Stripes, Wicket, or Play (I never used it myself though).

Adeel Ansari
I would like to add Seam to that list of frameworks. Quite easy to use and for me it was more productive than Wicket.
Maurits Rijk
@Maurits: IMO, Seam will become an overkill here. Actually, Seam is a full blown enterprise application framework, and its using JSF as a web framework. In my experience, JSF becomes hairy for beginners. Further, I tried to recommend only for the web part. FYP, I also like Seam, BTW.
Adeel Ansari
+1  A: 

There's absolutely no reason you can't have the logic in Java, and use Rails or similar to provide a way to easily display/modify your DB through a web-browser interface.

That said, Java is very widely used for this kind of things so I don't believe there are real problems, compared to the cost of learning a new technology.

John
A: 

If you were using raw Java to format the HTML pages, take a look at JSP as an alternative. With JSP, you end up writing HTML, with embedded tags (or Java code fragments) to render the contents of your Java data structures.

This would probably be a smaller learning curve compared with learning Django or Rails, and you could reuse most of your existing Java code.

Stephen C
A: 

Don't become a fashion victim. The Java platform is a very strong, proven technology. If you already know Java, and you have the logic, why switching.

Andrei Ciobanu