views:

126

answers:

4

I have backend code written in Java. The code has about 12 classes. However my partner on this project who is writing the interface (which uses Ajax) is more familiar with C# and .net. What would be quicker to learn Ajax with Java or to rewrite it in C#.

+1  A: 

That's a big subject area you are opening up and you should go buy a couple of books and do some web research.

I got started with the Eclipse Web tools package and still use it. I was already using Eclipse for my Java development at the time so the transition was very smooth.

Edit: Holy crap you completely changed the question!

Simon
Yeah sorry no one was answering the old one :)
Ankur
A: 

Straight Java and Ajax would involve some serious servlet programming. You'll probably want the aid of a web framework, i.e. JSP, Groovy, Tapestry, Wicket, Spring MVC, etc. Also, a Javascript library would help with the boilerplate AJAX and DOM manipulation stuff, i.e. jQuery or Prototype. The downside is that you'd have to invest time to learn these frameworks, though depending on the complexity of your Ajax, I bet you could get something running in a day or two.

jtgameover
My friend knows JQuery and I have messed with Spring MVC. Is this the way to go in your opinion?
Ankur
Those are valid choices. We're using jQuery and Tapestry. You'll only find out whether it's right for your application when you try it...
jtgameover
the thing is, as long as the server side obeys some contracts (such as returning data in a known json/xml format), the UI developer should be able to work on the UI without knowing or doing anything serverside.
Chii
+1  A: 

If you have a standard Java servlet infrastructure and no surrounding framework, you may want to try out direct web remoting. It's an additional config/.jar in your web.xml and little else on the server side.

It exposes nominated Java objects as Javascript objects automagically and makes enabling your Java domain objects in an AJAX environment very straightforward (trivial, in fact).

I've used this to migrate an existing servlet application to a more AJAX-focused solution and it works very well.

Brian Agnew
A: 

AJAX frontend should not know nor care about backend. Frontend sends requests to a controller and receives back JSON (XML,...) responses. Just download some decent AJAX javascript framework (there are lots of them - jQuery, Prototype, ExtJS etc) and it will handle all the low level communication stuff for you.

serg