开发者

Which is better framework Java/GWT or Scala/Lift?

开发者 https://www.devze.com 2023-01-20 14:07 出处:网络
I wanted to start a new web application project and I am confused between two frameworks that is GWT(Java) or Lift(Scala). So I want your opinion which o开发者_如何学编程ne I choose? Both are good acc

I wanted to start a new web application project and I am confused between two frameworks that is GWT(Java) or Lift(Scala). So I want your opinion which o开发者_如何学编程ne I choose? Both are good according to my project requirement. So on the basis of frameworks comparison please tell me which is good?


I have found GWT to be an extremely effective technology for the client side, and use a combination of Java and Scala on the server-side.

GWT is attractive because it allows you to write your web application in Java from front to back; you code in Java; and you debug your program in Eclipse, seamlessly stepping from client code to server-side code and back again. It truly is a wonderful thing.

Scala is a beautiful language, and I'm in love with it like everyone else. If only there was a GWT variant based on Scala! Some work has been done in that direction already. Gradually, I've migrated most of my server-side code to Scala, to my great satisfaction.

If you were to use Lift, how much JavaScript coding would you need to do? Are you comfortable with JavaScript? How complex is the client-side behaviour of your application to be? For fairly straight-forward client-side logic, I'm sure that Lift will prove satisfactory. If you want to build a very desktop-like application, and/or you are particularly concerned to squeeze the last drop of speed from your app, go with GWT. Either way, you'll not be disappointed; they are great technologies to invest in.

Consider too that IDE support for Scala is still very nascent. Frankly, I think that any productivity gains that I might have seen from using Scala have been lost on various time-wasting struggles with Scala IDE for Eclipse. The story may be marginally better in IDEA, but not by much.

Perhaps you might allocate yourself a fixed amount of time to exploring Lift and GWT, and make your own decision based on what you are able to conclude in that time. Be disciplined and stick to the time box you've set aside.


Don't forget you can also use GWT with Scala (server side code on Scala and client side on Java).

There is also some difference in what these combos are best at. For example, Lift has uber comet support and GWT is better for richer clients and can reduce number of server requests.

I'd chose Lift unless you need really rich client side or enormous scalability (e.g. no sessions, lots of client caching etc).


Personally, I'd advise Lift. But it's a purely human-driven recommendation and nothing to do with the relative technical merits of the two frameworks.

The fact that you even know to ask this question suggests that you already know Scala, like it, and probably want to use the language further. In this case, if you were constrained to then write an application in Java, I imagine you'd get quickly frustrated.

Although Scala can be used with GWT, you'll find that Lift has much better support for some of Scala's nicer features (i.e. actors). So for this reason I'd favour Lift.

You might also want to investigate Scalatra and Play as alternative web frameworks for Scala.


They both produce a web app, but are different frameworks in nature, so I don't see how they can be compared. When you say "good," what criteria do you have in mind?

Edit:

Scalability and performance depends on the type of transactions and data backend, but all things equal, you'd have better chance with Lift/Scala.

From @dpp's interview:

  • Lift has better support for Comet than any other web framework... and that's why Novell chose Lift for the Pulse front-end.
  • Lift has excellent Ajax support.
  • Lift is persistence agnostic, so it works with your existing Java model objects and business logic.
  • Lift's REST support is far more flexible and secure than REST support in any other JVM web framework.


I am about to embark on a Web UI project myself, so I found this thread to be very useful. I know that the original post was meant to compare the respective merits of GWT vs Lift, but you might also be interested in looking at Vaadin (http://vaadin.com/home). It uses GWT for rendering in the browser, but most of the UI structure and logic is implemented on the server side. The server side code can be implemented in any JVM languages (so therefore you can use Scala). So if you are a Scala fan this could be a suitable solution for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消