JSF vs ASP.net
DuncanE asks: "We are looking at migrating an old legacy database application to a newer web
based framework for the front end. For me the two obvious choices are ASP.net vs
Java Server Faces. CodeGuru has
side by side look at both, but does anyone have any real world comparisons? ASP.net appears to be MS only, which is a concern, depending on how mature
mod_mono has become." Which framework would you prefer to use? Under what situations and conditions would you recommend the use of the other?
I think Java would be a more 'safe' choice.
.net solutions are somewhat similar in the quality of their solutions, and that any marginal difference in quality, if they exist, would have no impact compared to the freedom of choice Java provides.
Java Server apps can run on multiple operating systems, multiple servers, and in the extreme case of Sun not supporting it anymore ( or not adding a feature you want) you've got tons of big companies pushing it, like IBM and others, in addition to open source implementations like GNU classpath. Not to mention that you can implement 100% of your solution without paying anything.
ASP.net, on the other hand, is a Microsoft solution, and you depend on the whims of MS for everything. It runs on little more than Windows/IIS, and the only serious IDE for it would be Visual Studio.net, and good luck trying to run it under mono if you favorite class or function is incomplete or has a bug in its mono implementation ( or the MS implementation for that matter).
I think that the Java and
Both are a good choice if you want to properly engineer a new web-based tool. ASP.NET is probably quicker but if you want to do anything really serious you'll probably want to look at purchasing Visual Studio 2005 rather than just using the Visual Web Developer Express. Also the tool support for JSF isn't nearly as mature so it will probably take longer to implement in JSF than in ASP.NET.
.NET. If portability is a big issue and you'd really like to run this application on a small server running Jetty(for instance) then go for JSF.
Having said that JSF is still a good choice - particularly if licensing costs and portability are an issue. Apache MyFaces is an excellent framework whose only downside is the poor documentation. JSF can be slower to get started with but I found that it enforces best practices more strictly and once you get the hang of all the XML wiring it wasn't that bad. Another benefit of JSF is that you'll have trouble breaking the MVC pattern but you can pretty easily embed alot of code in ASP.NET unless you properly use code-behind and deliberately seperate out the DAL which isn't the default for the point and click wizards (the DAL separation).
In the end it comes down to a few things. If you have existing C#/VB skills and don't mind being stuck with IIS then go for
groklaw, wired and slashdot. The holy trinity of work based time wasting.
In terms of being able to create and serve a web page, either one would probably WORK, but I think Java is a much better platform. Let me share with you my reasons why, keeping in mind that I'm a professional developer with eight years of production experience. Also, I've developed on Apache (straight HTML and some CGI), JSP (on Red Hat servers with Apache Jakarta), ASP3 (IIS with COM+ middleware and Oracle backend), ASP.Net with web services AND some COM+ middleware and oracle backend, and now, Oracle 10G with Java everything (basically).
.Net-ish, and it's free, but I don't think Mono matches the sheer breadth of Java offerings you can acquire at zero to no cost. Java buys you almost complete freedom from vendor lock-in, if you play your cards right. .Net, in comparison, is vendor lock-in INCARNATE.
First of all, every platform in use supports Java, and you can download almost anything you might want to use for free. This is going to save you a bundle. YES, I know that technically Mono is sort of
Second, Java has an amazingly rich class library. If you can think of something you might want to do with a computer, there's a java library in there somewhere which will let you do it -- usually relatively easily, too. Although C# is approaching this level of functionality, I don't think it's exactly equal with Java yet. Close, maybe, but I think Java still has a little edge. Which makes sense, when you think about it -- Java's been around for several years longer.
Third, most major vendors are now completely behind Java. Sun, IBM, Novell, and Oracle, for instance, are all putting their collective might behind the platform. That's pretty significant. It means that new innovations from these companies are going to be available in Java FIRST. Also, when you're ready to ramp up to big iron, you're more likely to be able to do so with Java, because all the big players there are Java shops.
Fourth, you can download Oracle Express for free, and use it with Oracle's Java developer's tools to build a rather interesting type of system. Oracle's considering an interesting approach here; give away the low-end database so that as companies grow they think about going with Oracle first. That's pretty good business; be generous first, so you'll be thought of when it's time to purchase something big. And this can work for you.
Fifth, the same skill set your developers use to create Java-based apps on your web server can be used to program just about anything from a Microwave to a PDA to cars and trucks (believe it or not, yes Java's finding its way into some vehicle systems). Java's everywhere these days; the language is the same, only the API changes. That makes your Java skillset very portable.
Finally, I think JDBC is a little nicer than Microsoft's database approach. I've programmed both ways, and I like the Java approach better. It's easier, for one thing; I write less code working with Java (YES, I know, it's astounding, but nontheless true).
I could go on, but you see where I'm going. Java's the nicer of the two platforms, and you can't really go wrong choosing it.
If you go with Java, there are plenty of other choices than JSF. Struts, while a bit verbose and showing its age, is a very mature framework that scales well and has been used successfully in lots of projects. A lot of people recommend Tapestry or Cocoon. It all depends on the size of your project and what people are experienced with.
A good thing with Java, no matter which framework you choose, is that you have a huge number of open source tools and libs to help you (Eclipse, Netbeans, JUnit, Ant, Maven, CruiseControl, JMeter, PMD, Checkstyle, xdoclet, Hibernate, Spring, Tomcat, commons logging, jsch...) , and there are also plenty of books, online tutorials, and programmers around who know Java.
Being bitter is drinking poison and hoping someone else will die
If you're looking into alternatives, perhaps you should consider Apple's WebObjects. It's essentially what JSF is trying to be, along with a robust, mature, *lightweight* JDBC object-relational mapping and object persistence layer that is scads more mature than Entity EJB's. Pure Java, runs on J2SE 1.3.1+, deployment licenses amount to $499 per server (free with XServes). It's also highly scalable -- this is the technology that drives the Apple Store online, the iTunes Music Store, and Apple's .Mac service.
--Paul
(disclaimer -- I work for Apple; however, I've been doing web development using ASP, J2EE, and WebObjects for years. IMHO WebObjects is far more elegant and robust than the alternatives.)
FileUpload from jakarta would be used for that as it's pretty much the de facto choice. There are other options like javazoom but it's an easy add-on. The apparent lack of a file upload control is probably reflective of the fact that Java allows multiple ways to do the same thing (which can be very confusing to someone new to the field) where MS products tend to have all the features included whether you use them or not. The JSF user community is not that small and is growing (although there are about 10x as many Struts jobs as JSF jobs currently in the UK) so it's one to take seriously.
The back button is an issue with JSF and is another reason why I use Struts for java web apps alongside it's easier integration with JSTL and greater maturity.
Not really, unlike ASF.Net JSF is just a specification, you get stuff like date controls file upload controls etc usually from component packs. If you want a good out of the mill solution in JSF with most components you need, start with MyFaces.
The usual mistake many people do with JSF is that they just look at the RI and then dismiss it as all there is, while literally hundreds of components linger around on the net for free and about the same amount in commercial solutions.
Things are moving fast in the apache world, actually the controls are not very buggy anymore (You probably checked then out a while ago). Much has been done in the last year. for a good demo check this: site out.