Live data from Hacker News

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

playframework.org

61–70 of 103 posts

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

#61
post #56
post #43

Earlier quoted context omitted.

Yes. PHP does the same thing. Actually, most frameworks do that; very few keep state within the application server between requests. Statelessness, in that respect, improves scalability.

PHP has session variables to put state objects into which are persisted between requests. Right?

PHP's sessions are stored in files by default, not persisted in memory.

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

#62
post #56
post #43

Earlier quoted context omitted.

Yes. PHP does the same thing. Actually, most frameworks do that; very few keep state within the application server between requests. Statelessness, in that respect, improves scalability.

PHP has session variables to put state objects into which are persisted between requests. Right?

Yes, but most people who make serious use of them hook up a custom session handler that writes session information out to the database (the default implementation that ships with PHP uses the file system). Sessions that are stored in memory by the application server instantly prevent you from load balancing requests across multiple servers and hence kill your scalability - unless you implement sticky sessions which adds yet more complexity. Personally I try to avoid using session storage whenever possible - I've recently started using signed cookies in their place.

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

#63
post #53
post #43

Earlier quoted context omitted.

Yes. PHP does the same thing. Actually, most frameworks do that; very few keep state within the application server between requests. Statelessness, in that respect, improves scalability.

...while reducing perfomance...

Yeah. Sometimes per-request page performance is less important than overall throughput, though.

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

#64

Nice collection of web tools. Especially ready made libraries for validation, captcha etc and a built-in template engine. But I am not convinced with 'on the fly' compilation because most editors already do a better job there and refreshing the web page to look for compilation errors does not look productive.

If you use a Java IDE you will of course see compilation errors before trying the app in the browser. So it is not a problem.

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

#65
post #55
post #44

Earlier quoted context omitted.

If you are a one man show maybe, but if you are a team it is far more maintainable because each concern is clearly delineated. JSP is not easier for a HTML designer nor is ASP or PHP it is an amalgamation of languages composites into a document. It is only easier for a code developer and that it the crux. Usually a company starts out as a one man shop with a code developer and then graduates to a team. Having to teac…

I typically work with largish teams on very large websites (cingular.com, jcrew.com, ulta.com, pcavote.com, etc...). With good frameworks most JSPs are very close to normal HTML and we actually usually have: designers/UX folks who provide PS docs/images/etc..., front end devs (JSP/JS/AJAX impl folks) who take those and make real working JSP pages out of them, and back-end devs who write the Java backing components. Y…

You are not taking into account, distributed development teams or completely outsourced development of certain portions of the overall solution In which you have no control over the skill level of the developers.

As well, I am not proposing anything any more non standard than say JSP or Struts and Tiles. Their are plenty of AJAX frameworks that provide all of the bolts to erect this style of system without building and in-house system. Further, JSP is only standard for web development it does not take into account the variety of UI possibilities and that is the point of the matter. The UI much like the database is only a portion of an overall system. Just as you would not write you data-storage in your logic tier you should not be coupling the UI tier to your business logic.

There are plenty of sites that use this development methodology. Pick almost any mature "Web 2.0" site and they will be somewhere along in this evolution. Google, Amazon, Yahoo et. al.

I apologize in advance for being vague, but I would prefer to not loose my anonymity on this site and referencing my work would do so.

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

#66
post #55
post #44

Earlier quoted context omitted.

If you are a one man show maybe, but if you are a team it is far more maintainable because each concern is clearly delineated. JSP is not easier for a HTML designer nor is ASP or PHP it is an amalgamation of languages composites into a document. It is only easier for a code developer and that it the crux. Usually a company starts out as a one man shop with a code developer and then graduates to a team. Having to teac…

I typically work with largish teams on very large websites (cingular.com, jcrew.com, ulta.com, pcavote.com, etc...). With good frameworks most JSPs are very close to normal HTML and we actually usually have: designers/UX folks who provide PS docs/images/etc..., front end devs (JSP/JS/AJAX impl folks) who take those and make real working JSP pages out of them, and back-end devs who write the Java backing components. Y…

"You seem to be expecting these new developers who are just learning HTML to know how to build complex pages using aggregate web service calls via JS, based on a non-standard in-house system."

Sorry I missed hitting on this one. I do not expect a designer to be doing service calls that is the point. You can write a JavaScript controller that grabs reference to any UI components that it needs, you do not write JavaScript in the HTML, the designer is then working in pure HTML CSS. The JavaScript developer is the one orchestrating the work-flow logic in a code-behind manner. Each person has their domain and once a developer feels comfortable they can graduate to the next domain. Just as I don't expect a HTML designer to have to know Java constructs I don't expect a Objective-C developer to know HTML constructs. It's not about constraining people, it's about re-usability of reusable components and isolating non-reusable components.

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

#67
post #42

Hmm, too much code in the template library, too much magic in general. I do like the general packacking, the automatic compilation and the snazzy error and testing interfaces. Seems a bit hard to change from their Groovy template system to something like StringTemplate, though.

Although I think that the built-in template system is very very nice, it would be really easy to write a play module that provide any template engine you want.

Well, both systems are basically diametrical opposites. StringTemplates is very strong on MVC separation whereas the play templates feature a fully-fledged programming language.

I'll have to dive deeper into play to see how much more I would have to do in the Controller part to prepare the output for the template...

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

#68
post #62
post #56

Earlier quoted context omitted.

PHP has session variables to put state objects into which are persisted between requests. Right?

Yes, but most people who make serious use of them hook up a custom session handler that writes session information out to the database (the default implementation that ships with PHP uses the file system). Sessions that are stored in memory by the application server instantly prevent you from load balancing requests across multiple servers and hence kill your scalability - unless you implement sticky sessions which a…

Interesting. I mostly build J2EE apps and sticky sessions support is built in. Complex apps require a fair bit of session state (user profile, shopping cart, custom catalog, breadcrumbs, user promos, etc...) in general and the idea of having to persist and reload that data over a network (db or memcached) for each request would absolutely kill page response times. I guess it depends on how heavy the session data is for your app.

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

#69
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…

The "way we've always done it" in my brain does not like the thought of putting all the client stuff in, well, the client. I'd like to hear more about this style of development. Do you have examples of this being done, postmortems, blogs espousing this, more info, etc?

This has allot of links into the concepts behind the architecture:

http://www.it-eye.nl/weblog/2008/09/05/client-server-20/

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

#70
post #46

Earlier quoted context omitted.

Because this is a premature optimization. I've seen companies falling at the other extreme ... making the interface "totally" decoupled, so that they could replace the UI anytime they wanted. That's why monstrosities like XSLT appeared. But I haven't seen any example of a good application yet that does this successfully, because whether you like it or not, the web UI will require backend logic that your iPhone app do…

No XSLT was an attempt to make the UI generic, either you accept that UI are a custom tailored to be optimized for the platform or you accept the dumb terminal philosophy where you try to generalize the UI to adapt to all platforms. The fact remains that human preference is for tailored UI and not until AJAX took hold was the desktops dominance as a platform threatened. Time and time again, tailored UI's are preferre…

Google and Amazon?

I know that they are using lots of web services, but the assembly is still mostly done on their servers (not in the browser), and you're talking about something else (or have I understood you wrong?).

I've seen a talk from an Amazon fellow. They are using web services for parallel processing ... their frontend servers are sending asynchronous requests to those services, which is a huge win.

But in a browser, for an Ajax frontend that happens to periodically request updates, one thing that happens is that the number of requests made from a single client is a lot larger. Surely it doesn't reload all the static files, but those are non-issues even for a reasonable high-traffic website ... just put something like Varnish to serve them and make sure they have expiration headers in the future.

My company did consultancy work in matters of scalability for http://www.erepublik.com/ and after we placed a Varnish in front (that also functions as a load-balancer for Apache servers) it could handle thousands of concurrent requests to static files. And their biggest problem was definitely not the load on their Apache servers (it was MySql).

And this is mostly what I was thinking about.

Post reply on HN