Live data from Hacker News

Play framework for Java - a radical rethink of Java web app development?

playframework.org

21–30 of 103 posts

Re: Play framework for Java - a radical rethink of Java web app development?

#21
post #17

"The Play framework makes it easier to build Web applications with Java" Maybe you should not be building web applications with Java or C# or . Maybe you should be building web services with these languages and using AJAX, a client side toolkit, Javscript, HTML and CSS to build a UI that communicates with said services. Maybe this decouples your UI implementation from your business logic implementation so you can go…

A web service isn't a web application?

Re: Play framework for Java - a radical rethink of Java web app development?

#23
http://m.mlb.com/ uses a hybrid Freemarker / Groovy / Java framework called MVC+GF. During the 2009 season it was able to scale with out issues during peak hours (9th innings, etc). That's hundreds of requests a sec a server - pretty cool.

Groovy is used cause it has closures (java doesn't) and is simpler and easier than Scala.

Re: Play framework for Java - a radical rethink of Java web app development?

#24
It reminds me of Sinatra. The HTTP paramater/object binding is similar, for example: http://www.playframework.org/documentation/1.0/5things

A difference is that the routes, model, controller and template/renderer are in separate directories. It's a bit awkward for the simple project of the one in the video, but essential for more complicated projects.

It even includes a captcha generator, and their examples seem to be of real (though very simple) applications - as opposed to toy academic ones. I get the feeling that its developers are very familiar with the real needs and problems of actual web development.

It almost makes me want to get into web development! The only thing is that combining HTML, Groovy templating, Javascript and JQuery looks a little complex - but they're probably very straightforward for common tasks.

Re: Play framework for Java - a radical rethink of Java web app development?

#25
post #17

"The Play framework makes it easier to build Web applications with Java" Maybe you should not be building web applications with Java or C# or . Maybe you should be building web services with these languages and using AJAX, a client side toolkit, Javscript, HTML and CSS to build a UI that communicates with said services. Maybe this decouples your UI implementation from your business logic implementation so you can go…

In my experience breaking everything down into a bunch of uncoupled services, ala SOA, adds a significant amount of performance overhead making all these web service calls to build up a semi-complex page. Performing all the logic within a single process/JVM is MUCH more efficient.

And that's with LAN based WS calls. I can't imaging doing that over the internet. You have a page that has 20 independent dynamic blocks, you really want to make 20 HTTP request/response calls over a 60+ ms latency connection? You really want your server cluster to have to handle 20 connections instead of one?

Maybe for a simple and/or low traffic site, but for a moderately complex website/webapp, you're better off serving out a single page.

Re: Play framework for Java - a radical rethink of Java web app development?

#26
post #17

"The Play framework makes it easier to build Web applications with Java" Maybe you should not be building web applications with Java or C# or . Maybe you should be building web services with these languages and using AJAX, a client side toolkit, Javscript, HTML and CSS to build a UI that communicates with said services. Maybe this decouples your UI implementation from your business logic implementation so you can go…

A web service isn't a web application?

Neither is an IPhone app, but I can guarantee you that most of the logic I use for my "Web Application" will be reused by my IPhone application. With the exception of my templating, work-flow and UI specific logic, so it begs the question why am I implementing my templating, workflow UI specific logic, in my "Web Application" (it's not reusable). Unless it really is a web UI to my enterprise application in which my UI should be worried about its concern? I see so many new companies fall into this trap and then have to do major rewrites when they realize they have boxed themselves into a "Web Application"

Re: Play framework for Java - a radical rethink of Java web app development?

#27
post #3

Java has real lightweight threads, so what's the advantage of "shared nothing" here? Extra memory usage and less speed?

Java's threads are managed in kernel space, not at the VM level and are definitely not "lightweight".

They are faster than forking processes though, but Java applications (because they share state between threads) are less scalable.

Re: Play framework for Java - a radical rethink of Java web app development?

#28
post #13

What is the virtue of developing a web application in Java instead of a scripting language like Jython (aside from execution speed obviously)?

Well, at my day job, not having to throw out 10 years worth of legacy code would be considered "a bit of a plus". We also have 1,200 employees and precisely two engineers who have ever done a Rails application more complicated than the 15-minute-blog demo. I think we have one guy who coded a Python app once. Our favorite contractors and outsourcing providers also have (comparatively speaking) deep skills in Java and…

If you pick as JVM language as suggested, why would you need to throw out any code?

When I worked at ITA Software which writes much of their stuff in Lisp (not the web stuff though), there was often worry that it meant new programmers would have to learn the language and so wouldn't be productive at first. But learning the code base takes a lot longer than learning the language, at least enough of the language to get significant stuff done.

If you have 10 years worth of legacy code written by 12,000 employees, I assume you're in the same boat.

Re: Play framework for Java - a radical rethink of Java web app development?

#29
post #11
post #3

Java has real lightweight threads, so what's the advantage of "shared nothing" here? Extra memory usage and less speed?

It seems to refer to this: > "Play is designed to operate in a ‘share nothing’ architecture. The idea is to keep the application completely stateless. By doing this you will allow your application to run on as many server nodes as needed at the same time. >What are the common traps you should avoid to keep the model stateless? Do not store any object on the Java heap for multiple requests" If that's all they're talki…

I haven't done any real dev with those frameworks you list so I'm wondering how do you manage session state? user profile, shopping cart, breadcrumbs, multi-request flows, etc...

Do you write/read all that into the db/memcached for each request?

Re: Play framework for Java - a radical rethink of Java web app development?

#30
post #25
post #17

"The Play framework makes it easier to build Web applications with Java" Maybe you should not be building web applications with Java or C# or . Maybe you should be building web services with these languages and using AJAX, a client side toolkit, Javscript, HTML and CSS to build a UI that communicates with said services. Maybe this decouples your UI implementation from your business logic implementation so you can go…

In my experience breaking everything down into a bunch of uncoupled services, ala SOA, adds a significant amount of performance overhead making all these web service calls to build up a semi-complex page. Performing all the logic within a single process/JVM is MUCH more efficient. And that's with LAN based WS calls. I can't imaging doing that over the internet. You have a page that has 20 independent dynamic blocks,…

No one said that they have to be micro services. One should provide composite services that provide all of the data for a work-flow. Then use a pub-sub event based model to notify the UI of available data. This way components stay loosely coupled and are only listening for an event that injects the relevant data that they need. This results in a single call to a composite service yet the micro services are available should a different UI need a more microscopic flow or data load (for example, limited memory on a mobile device).

As well another common mistake I see is services calling services to build a composite service. If at all possible services should be the facade into the system with logic wrapped up in a jar, DLL, etc. All services if possible should rely on said library and not rely on loosely coupled services for composting, inter-system communication is different than disparate system communication.

Post reply on HN