Live data from Hacker News

Developing and running a Java EE Hello World application

wiki.jetbrains.net

51–60 of 84 posts

Re: Developing and running a Java EE Hello World application

#51
post #32
post #12

Setting up any web stack is a pain in the ass and probably just as long of a tutorial. For example, write out a tutorial which goes from base Ubuntu install to "hello world" on Rails, I bet it's just as long or longer. I suppose it depends on how much detail you want to include. There are just more "one click" install options for other stacks.

How about: apt-get install php5 apache echo " Hello World " > /var/www/index.php The end.

    apt-get install php5
    echo "Hello World" > /var/www/index.php
    php -S 127.0.0.1:8080 /var/www/

Re: Developing and running a Java EE Hello World application

#52
post #42

I've also done some JEE quite a long time ago and I hated every second of it. I'm not sure however if my experience is representative of the the Java community. There is no problem with the language itself nor the VM which is also working quite fine (while taking a lot of RAM). But I really have a problem with the community, everything seems over-engineered and super complicated in Java, even with simple things. Noth…

> they are building pyramids while other languages are building stuff out of bricks Pyramids are engineering feats, Java EE people are building stuff which look like works from M. C. Escher, it bends your mind when you try to understand the code :) Also a little anecdote to the complexity of enterprise stuff: at the company I worked before, they were writing an entire persistence framework from scratch (with annotati…

Also well known as the Enterprise Software Engineer Employment Guarantee Scheme

Re: Developing and running a Java EE Hello World application

#53
post #32
post #12

Setting up any web stack is a pain in the ass and probably just as long of a tutorial. For example, write out a tutorial which goes from base Ubuntu install to "hello world" on Rails, I bet it's just as long or longer. I suppose it depends on how much detail you want to include. There are just more "one click" install options for other stacks.

How about: apt-get install php5 apache echo " Hello World " > /var/www/index.php The end.

While amusing, I don't think that's a fair comparison as it's not using any framework or persistence features.

A Java app can be written similarly:

    apt-get install tomcat7
    echo "Hello World" > /var/lib/tomcat7/webapps/ROOT/index.jsp
(This is untested as I don't have an Ubuntu box at hand – the locations depend on your distro, as with Apache installs.)

There actually are sane people in the Java community – underneath the "Java EE" overcomplexity there are some regular old Java web frameworks that are pretty simple and robust. Unfortunately they can be easily overlooked, as the EE community is loud.

Re: Developing and running a Java EE Hello World application

#54
post #38

Earlier quoted context omitted.

> All that stuff makes it easier later to write more complex stuff I sincerely doubt that. I've seen E-Banking systems run on Jetty with JDBC directly. No fancy JSRs were needed. Btw: J2EE was indeed even more bloated than JavaEE. I don't think that anyone would defend J2EE nowadays, not even the folks behind JavaEE

Truth be told, the code quality of electronic banking is often rather questionable. Probably they developed a prototype without any bells and whistles (and without proper guards against code injection, without support for distributed operation) and then were forced to use it as the base of the real product.

One another reason for loads of standardization in JEE is with performance and scalability guarantees which are not provided by developers but by application container vendors.

Writing an E-Banking application on JDBC is certainly possible , but do we write code to make performance guarantees,for transactional isolation,maintainability or do we only write code for the business we need to attend, this is the question that leads to JPA [or JEE] .

JEE stack does involve a steeper learning curve but is a different one indeed!

Re: Developing and running a Java EE Hello World application

#55

Except that that's not just a "Hello Word" page. That's routing to the right page, transaction and session control, storing the text of the message in a separate class than the one that returns the response, and using a template to return the resulting HTML. Looking at the section with the actual example code in it, you could do it in about half that, if you wanted a simple version that just returned "Hello World". I…

This does almost everything (and sending it to another class is pretty trivial): http://flask.pocoo.org/docs/0.10/quickstart/

Yup. And by the time you've done all of that, it's not vastly smaller than the code in the original example.

(Also, your setup is spread across every class registering itself, rather than in one central XML file that tells you all of your routing.)

Re: Developing and running a Java EE Hello World application

#56
post #32
post #12

Setting up any web stack is a pain in the ass and probably just as long of a tutorial. For example, write out a tutorial which goes from base Ubuntu install to "hello world" on Rails, I bet it's just as long or longer. I suppose it depends on how much detail you want to include. There are just more "one click" install options for other stacks.

How about: apt-get install php5 apache echo " Hello World " > /var/www/index.php The end.

Java is the king of boilerplate, but this PHP snippet (in fact, not even PHP, just HTML) is not equivalent to the tutorial in question. The IntelliJ post covers things like, say, HTML templating or built-in debugger for your web app, which is a bit more than a bash two-liner in the PHP stack as well.

Re: Developing and running a Java EE Hello World application

#57
post #2

I don't do web apps with java, so I honestly don't know if it's the proper way to do it, a satire, or if there is a more straightforward way. Especially, I don't see why one has to write both the class HelloWorldServlet and HelloWorldBean; couldn't one just inherit from one class or implement one interface?

This page sets up an entire framework / java stack containing JEE, with some exampleclasses for stuff that will be needed later. So it's much more than a simple Hello World. Compare it to setting up any other framework: A lot of files and boilerplate configuration.

Re: Developing and running a Java EE Hello World application

#58

Earlier quoted context omitted.

This does almost everything (and sending it to another class is pretty trivial): http://flask.pocoo.org/docs/0.10/quickstart/

Yup. And by the time you've done all of that, it's not vastly smaller than the code in the original example. (Also, your setup is spread across every class registering itself, rather than in one central XML file that tells you all of your routing.)

No, it's usually done in a separate file containing all the routing (in most Python frameworks)

And no unreadable and overcomplicated XML for configuration, thank you very much

Post reply on HN