Slashdot Mirror


Ask Slashdot: Tips For Designing a Modern Web Application?

New submitter sdoca writes "I am a Java developer and for the past number of years I have mainly been working on server side code. I have an idea for a webpage/application that I would like to develop. For the general public, it will be a site where they can view upcoming events, filter them by type, date etc. and view details of events they're interested in. There will also be an admin section to the app where organizations who want to post their events can log in and set them up. In the long term, writing a view-only version as an Apple and/or Android app is on the radar, but I want to focus on the generic web app for now. I'm not sure what languages/frameworks to look at using for the webpage portion of my project. Many (many!) years ago, I wrote some applets. After that I did some work in WebObjects and after that I tinkered with Wicket. I have no experience with PHP and would like to stay in my Java comfort zone as much as possible, but want to use the right tool. I'm concerned about browser compatibility issues. Chrome didn't exist when I last did web page development. I'm looking for good resources (books, internet) that will guide me through the potential issues and your recommendations for a web development framework."

18 of 409 comments (clear)

  1. There's quite a few options out there, but... by pushing-robot · · Score: 4, Insightful

    If you're familiar with Java but not web development, it sounds like Grails might be a good place to start.

    --
    How can I believe you when you tell me what I don't want to hear?
    1. Re:There's quite a few options out there, but... by jasenj1 · · Score: 4, Informative

      I'll throw in a vote for Grails. It is a convention over configuration app framework that has you code your domain objects and then it generates CRUD pages for you.

      The documentation is pretty good. There's lots of tags for the web page side.

      It lives on top of Spring, Hibernate, & JQuery so it has some solid frameworks at its core.

      It uses Groovy as its language rather than Java, but Groovy is 100% compatible with Java and is mostly syntactic shortcuts & convenience tricks on top of Java (like no need for semicolons). So it is very easy to learn if you're a Java guy; you can slowly start using more idiomatic Groovy while still writing very Java-esque code.

      If Groovy scares you, try Roo (http://www.springsource.org/spring-roo). It's a pure Java based app framework also from Spring that uses the Spring libraries.

      Now, having said all that. If you plan to deploy to iOS or Android, you may want to consider RhoMobile (http://rhomobile.com). It is a Ruby-on-Rails environment that runs on top of the native OS. So developing a RoR app for the client-server PC side and then porting to RhoMobile should be very easy. I don't know of a solution on the Java side that will take a Java servlet based app and move it over to the mobile OSes conveniently.

    2. Re:There's quite a few options out there, but... by c0lo · · Score: 4, Informative

      If you're familiar with Java but not web development,...

      +

      In the long term, writing a view-only version as an Apple and/or Android app is on the radar

      +

      I have no experience with PHP and would like to stay in my Java comfort zone as much as possible, but want to use the right tool.

      In my opinion, give GWT a try. Why should make it exciting for you: the entirely dev cycle (this includes debug) is Java based - including the code in the "views" that will be shown in the browser (even if this code will be transpiled to javascript - a very compact one for the functionality it implements).

      Using GWT, the "presentation logic" is totally separated by the lower layers (in both "architectural" and "exploitation" senses): i.e. your business logic will implement only "services" type of functions, the "presentation logic" - in browser - will be in charge to render the data the way you see fit - no more server-side resources to be consumed by layouting the page, applying "data model basic consistency validation", etc - (oh, how I hated JSP at their time). Let the "client CPU" do a bit of this effort - if your application will be highly used, a bit from every client-side that takes some care about itself will get you some serious server-side savings.

      As I write, I'm digging into a piece of GWT that promises to take care of the integration with JPA entities, e.g. bringing Hibernate into the picture without the need of heaps of "plumbing code".

      --
      Questions raise, answers kill. Raise questions to stay alive.
  2. Play framework (Java) by Anonymous Coward · · Score: 5, Informative

    I just started playing around with the Play framework (Java/Scala) I'm loving it, and I'm coming from *gasp WebObjects, and .Net. I can't speak too much about its features but it's really simple to get up and running connected to a database and serving content, as well as creating REST api. Deployment is a single command.
    This is what I'm using for a tutorial: https://github.com/jamesward/play2torial/blob/master/JAVA.md

  3. Even more important by Anonymous Coward · · Score: 4, Insightful

    Forget PHP. The language has seen very little progress lately. But even that wouldn't matter, as PHP is slow and horrible. Very inconsistent as well, as the it's little more than glue between some libraries.

    1. Re:Even more important by shutdown+-p+now · · Score: 4, Insightful

      TL;DR version is that PHP is crap. For a lengthy treatment of the subject, see my sig.

  4. Re:Would anyone else recommend GWT? by Post-O-Matron · · Score: 5, Interesting

    GWT is good if you want to create a RIA, when the presentation logic is so complex developing it in javascript is a nightmare, but without having to use Flash or silverlight. If the presentation is simple enough however, I would stick to HTML5 + jQuery. In fact the "simple enough" bar in that last statement is gradually pushed forward.

    As a rule of thumb I'd say if you have a lot of moving parts on the page and you are basically creating a desktop application inside the browser ala Google docs, then consider GWT. Otherwise it will do more harm than good.

  5. Need some client side? by rHBa · · Score: 4, Informative

    To be honest you're gong to have to know some HTML/CSS at some point. It's considered impolite these days to insist (or expect) that the client side understands Java.

    In other words, assume that Java ISN'T supported on the clientside.

  6. Re:CMS and done. by Lehk228 · · Score: 4, Funny

    QDB.us #307623 wordpress is an unauthenticated remote shell that, as a useful side feature, also contains a blog

    --
    Snowden and Manning are heroes.
  7. Re:Use a Framework! by AuMatar · · Score: 5, Insightful

    Frameworks are good only if all of the following are true:

    1)You want to do exactly what the framework was set up to do. (in other words, everything about your app is cookie cutter)
    2)You aren't a very good programmer
    3)You already know the framework
    4)You don't want to do something wild and crazy, like write an sql query (the framework way tends to use 3 objects which define interfaces and require you to jump through hoops, all so it will automatically grab the data and unbox it for you in the format it assumes you want it in, rather than the format you actually want it in).
    5)You absolutely don't want to use any advanced database functionality whatsoever, since most frameworks these days assume that they can create and alter tables at will.

    If those first two things aren't true, you're going to spend an order of magnitude more time working around the framework's limitations than you will save by using it. If 2 and 3 aren't true, you'll spend more time learning how to use the framework than you'd save by using it.

    Frameworks are good for getting low to moderately skilled developers to pump out cookie cutter type apps quickly (so long as those apps don't need to worry about little things like scale and performance). They're absolutely horrible if you want to do anything novel, you need performance, or you actually know sql and just want to write a simple god damn query.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  8. Re:Most important by countach74 · · Score: 5, Insightful

    What do you mean you cannot build a 'modern' webapp using Java? It's done all the time. If memory serves, Gmail is in Java. I also disagree with PHP being the obvious choice. It's a lot like JavaScript: it's everywhere, so people use it. It doesn't change the fact that it's a piece of rubbish. Ruby and Python are much better suited towards modern web development. PHP is glorified template system that is extremely inconsistent and overall ass backwards. The whole notion of mapping a URI to a file is so 1990's.

  9. Re:There's two parts by Kergan · · Score: 4, Insightful

    CoffeeScript... That way, when your console tells you you've a JS error on line X, you need to check the code output by CS, and locate whatever code you wrote that could have generated the relevant lines, all the while coping with the fact that CS doesn't cover 100% of JS, and introduces its own set of bugs and quirks on top of those in JS. Good luck with that in the long term.

  10. Java is great for websites by htnmmo · · Score: 4, Insightful

    Almost all the sites I've built are written in Java. Stick with Java. I've written sites in PHP and I've also had to work on updates to some PHP sites. If you're already familiar with Java dealing with PHP will feel like a joke. PHP is great when you don't want to write your own software since there are so many publicly available stuff out there in PHP. Don't worry, you won't find a lack of Java libraries that will do anything you want to do.

    Don't bother trying to learn a new language because you'll just slow yourself down trying to learn the semantics of the language instead of the details of the new libraries you'll be using. I know java gets a bad wrap in terms of performance but I've always found that Java kicks PHP's ass in terms of performance in the tests I've done.

    The main issue with java is that when you're using a servlet container like Tomcat, the process runs constantly and takes up memory. It's not that much but it's hard to find Java hosting because the memory issues makes it hard for a webhost to put thousands of websites on the same server.

    Your best bet is going to be to find a cheap VPN when you get started but check the big webhosts to. I remember LunarPages used to offer JSP support in the past.

    There are a bunch of different frameworks. Stick to ones that are popular because you'd rather have some limited functionality now rather than an unsupported framework in the future. Which has happened to me.

    I believe right now that's Spring but Struts is still pretty popular too.

    I've found NetBeans to be a great IDE and it supports Spring.

  11. Re:Would anyone else recommend GWT? by SplashMyBandit · · Score: 4, Insightful

    GWT is great if you want interactivity. Also fits in well since you are a Java programmer. I've also recently discovered vaadin (http://vaadin.com) which extends GWT and provides much nicer themes than the default. Best of all, all the tools you need for GWT/vaadin development are free (both zero cost and source is available); Java, Tomcat, Eclipse or Netbeans, GWT + GWT plugin (for debugging in your browser), vaadin and the all-important community documentation/forums (that is, you don't have to pay for a subscription like MSDN). Best of all vaadin/GWT handles almost all of the browser variation for you (although there are differences in CSS for advanced styling).

    Since you are already a Java programmer I would say you'd be mad to go past GWT (which you also develop for, and can debug in Java). Other solutions are ok for static page-oriented viewing but for a complex dynamic site it is hard for a competent Java programmer to be more productive than with GWT (except for the smaller sites with not a lot going on). How do I know, well I use GWT daily - including building complex sites for managing medical information for our national-level health ministry.

  12. Re:Most important by Anonymous Coward · · Score: 5, Interesting

    Google is not a PHP/Python shop. The four development languages are C++, Java, Python, and Go.

    Gmail is indeed written in Java.

  13. Re:here is the most important tip... by Jah-Wren+Ryel · · Score: 4, Insightful

    Any of the Gawker Media websites, some times you have to reload t hem 3 times to get the fricking hyperlinks to work.

    A little tangent....

    Gawker's websites suck in other ways that relate to usuability too. I use noscript religiously, there is nothing about the gawker websites that need javascript, but all you get is a nearly blank page if you don't enable javascript. UNLESS you change your brower's user agent to something Gawker doesn't recognize as supporting javascript (I change mine to an old version of googlebot). Then they send you pages that work perfectly well without javascript.

    So clearly they can do non-javascript pages, but if they recognize your browser they won't give them to you and even worse, they won't even explain what's going on, it just silently fails with a blank page. They can't even be bothered to tell you to enable javascript, which is really just pathetic.

    --
    When information is power, privacy is freedom.
  14. Re:Most important by Jane+Q.+Public · · Score: 4, Insightful

    I second countach74.

    Python, or my personal preference Ruby, are vastly superior choices. Django and Rails are intentionally -- and more to the point, well -- designed to be friendly web frameworks, built on top of their respective languages.

    I don't even call PHP a "language". It is just a hodgepodge of inconsistent utility functions bundled together. PHP was originally designed with the Web in mind, and only later added pretensions of being a general-purpose language, with Object Orientation kind of bolted on even later as an afterthought.

    Because Python and Ruby are far more internally consistent than PHP (Ruby even more than Python, in my opinion), they are also easier to learn. However, learning the language and also the framework entails some serious work. That is just the nature of the beast... there is no getting around it. You need to know the language, the framework, HTML, CSS, and JavaScript.

    Nobody said serious web development was easy.

  15. Re:Most important by PCM2 · · Score: 4, Informative

    You're talking at cross purposes here. Obviously the front-end UI of any modern Web application is going to be written using a lot of JavaScript. Java, Python, and PHP -- and many other languages -- are primarily for the back-end code. Gmail is certainly not accessing its database or implementing IMAP and SMTP in JavaScript.

    --
    Breakfast served all day!