Why Java is still used in web development? I'm just curious..
There are a number of reasons:
1. It is by no means a dead language. There are thousands of Java developers out there.
2. Many available Java developers means that it relatively easy to find maintenance programmers if necessary.
3. The Java / J2EE architecture is robust and reasonably elegant. It makes it possible to architect well built applications.
4. The free tools available for it are enterprise ready. For example, Apache / Tomcat / JBoss are a solid foundation to build a web-app from.
5. Excellent support for developers. Eclipse is one of the best developer platforms available. Ant and Maven support for Java is excellent.
6. There is a good availability of third-party (and open-source) libraries and Eclipse plug-ins for most of the additional functionality that might be needed but does not come in the core libraries.
7. There is also great support tools from commercial vendors: ORacle; IBM / Rational; etc.
8. Updated versions with newer language constructs are constantly being developed.
In short, it is a good tool for the job. It is compares favourably to other development platforms (.Net, Ruby, etc), and perhaps is better than some.
Simple. It's a cross platform environment, that is clearly defined, and controlled. Sure, Sun has a big deal of say in what is available in the Java environment, but there is plenty of 3rd party support and development in the Java environment.
Yes, Java applications start up slightly slower than Native applications, but take a look at VUZE... Once it's started, it's nearly native speed (or at least it was when I was using it). With the JIT (Just in Time) compilers, code caching, and other features, there isn't much of a reason that there would be a major speed penalty...
One big reason I think is because it's platform independent meaning they can easily run on all operating systems as long as you have the Java Runtime Environment installed. This could allow you to, for example, compile code in Windows and deploy on Unix.
I would also add that while this is only a con against .Net, your application server doesn't have to be Windows so it is cheaper to throw more hardware at it.
For the same reason as why COBOL and FORTRAN still exist. Because the language has proven itself to be robust and reliable.
Compare it with cars. Some people want the latest models because it has more power, better speed, improved features and whatever more. Others will just use a reliable car that's made to last for many years without much need for additional maintenance. Some buy a new car every 3 years, others will use their cars for half a century or more.
When talking about Java & the web, people seem to happily mix things by concentrating on Java applications deployed with Web Start (or even Applets), and forgetting that Java is a common language for implementing plain old dynamic web sites (or web applications). The latter is especially true for larger, more "enterprisey" systems. Even if on the desktop Java never really took off, on the server side it certainly did.
Without going into much detail, a couple of reasons why Java is used for creating web sites / applications:
It's a tried and true approach for building large-scale web apps. Either using just the basic (Java EE) technologies of Servlets and JSP, or newer frameworks built on top of those, such as JSF, Wicket or Google Web Toolkit. (Just one example of high scalability: Gmail is implemented in Java, using Google Web Toolkit.)
A mind-boggling amount of Java libraries exist, for all kinds of tasks — both open-source and commercial ones. If you need some in the backend of your app it may make a lot of sense to do the whole app using the same technology.
There are a lot of skilled Java developers out there — something that may affect tech desicions when launching (larger) projects
When creating a web interface for, or integrating into, an existing Java enterprise system (which are common) it may be beneficial to use the same language
Edit: I also agree with Doug about the tools and developer support. For example, IntelliJ IDEA may well be the most advanced IDE for any language (and I've heard this also from people who've used Eclipse and Visual Studio extensively... ;-) )
It's ubiquitous. The tools are great across the board. It's powerful. The community is huge. There is an amazing amount of available libraries / products / toolkits / frameworks. The JVM is great.
You can build cathedrals with this language. Those tend to stand for centuries.
Since Java doesn't run on the iPad, doesn't that hurt Java web development? Developing a web application that supports desktop and mobile is a possible path, but if your site uses Java or Flash, you have eliminated that opportunity.
We have a web application that is for both desktop and mobile (supports swiping, zooming, and such using jQuery). We decided against Java, Flash, and Silverlight because they do not work with iPad. The iPad is a growing base and web applications will have to keep up to support it.
It will be interesting to see how this affects web development with Java... time will tell.
Related
I'm writing this topic for learning purpose, not to start a flame war.
Basing on your experiences when It's highly recommended to use Java and not .NET, and when I must use .NET and not Java, also when I have the choice to use anyone of them in Projects development.
Thanks already.
The choice of language always depends on what you and your team know best and the problem at hand.
It's not common to do scientific computing with heavy numerical methods in Ruby or PHP; no one writes web apps in FORTRAN. The problem you're solving will affect the choice.
Your deployment environment will also affect the .NET versus Java EE choice. If you're a 100% Microsoft shop, .NET is an easy choice. If you have a heterogeneous environment, maybe Java EE is for you. If you like Linux, perhaps Java EE is preferred over Mono.
.NET and Java EE have evolved to solve similar kinds of problems. There's almost a 1:1 correspondence between features in the language, except for some advances like closures that .NET has added.
I have spent most of my web-development career in the Microsoft camp, but for different reasons I am trying to look at options.
Some years back I did a bit of Java/Struts development in eclipse, which was nice for its time but my memories of it are not close to what Visual Studio delivers today.
Some of the strengths of the MS stack as I see it are:
Ease of use. Free tools (express
editions), easy to set up, easy to deploy, loads of components and
support, even for cutting edge
features like ajax and jQuery.
Intellisense, so that the API
reference is there as you need it.
Size of the community. Things like www.asp.net,
with the free video tutorials,
samples, documentation etc. Free,
official and reliably updated
information from MSDN.
Enterprise scalable and decent
performance.
Fully object-oriented, (semi)compiled
languages, allowing for sound design,
patterns and practices.
There are of course weaknesses as well, like:
Pricing, once you go live with
anything semi-serious.
Vendor lock-in.
Total lack of cross-platform support.
I have spent some time this evening trying to get a grip on how things are outside of the microsoft world, and
I have found loads of PHP frameworks, Ruby on Rails and relatives, several Java frameworks and a few very odd alternatives.
Some of these seem very interesting, so I would like to hear from actual developers using the different frameworks, and try to find out how they compare to what MS has at the moment.
Which framework are you using, why is it great, what could be better and what kind of sites have you built using it?
Jeff & co made most of Stack Overflow in a few months using ASP.NET MVC. If you had to do the same using a non-MS framework and tools, what would you pick and why?
We have a pretty heavy investment in the Microsoft framework at the office and so I'm mostly doing ASP.NET MVC stuff now. If I were to pick an alternative at this point, I'd probably go with RubyOnRails. It has a very clean MVC implementation -- playing around with it made it pretty easy to get started with ASP.NET MVC when it came along. There's also a lot going on with improving testability -- particularly natural language-like testing frameworks coming out of the RoR camp with Cucumber, et. al. All the investment in testing makes TDD/BDD much more natural in that framework.
If I wanted to go opensource I would go with:
RAD web development: tomcat running Railo, a Java based open source CFML implementation because CFML is a good RAD tool. Railo performs well, is capable of clustering, is able to be extended through editing the source or adding your own extensions.
DB: MySQL for a DB backend because it performs well and just works.
IDE: - Eclipse + CFEclipse because that is what's available, although I want some improvements. Since CFML is a dynamic language you don't have Intellisense, just context help for the api.
OS: Any opensource unix based OS. Probably Ubuntu.
MVC Frameworks: Mach-II or Model-Glue because I'm familiar with them, although I'm open to checking out ColdBox.
I build web apps with:
PHP
Zend Framework
ExtJS toolkit
Aptana IDE
Disadvantages are the typical ones: lack of integration between the tools, weakness of debugging tools, complexity of deployment (although the deployment issue is true for pretty much anything except ASP when you're talking about windows servers).
I'm not too aware of ASP.NET, having only marginal experience with it, but the advantages as I would see them are cross-platform support, cheap hosting ability, architectural control (PHP is more low level, and Zend Framework is easy to buy into one module at a time, so you can more strictly control the behavior of each page).
I am using Django. It is easy to learn, very well documented and most of the brainy stuff happens in Python (assuming you like python). I develop all my HTML and CSS by hand using Aptana - gives better control but has nice helpful features.
Using many IDEs / editors you can get auto-complete based on the Django code-base (Netbeans, PyScripter, Komodo). You can then host on either Windows or Unix (Linux, Solaris, Mac).
There are many RIA frameworks popping up (flex, extjs, gwt to name very few).
If my server is written in Java, why not use java web start?
The benefits I see: I get to program in a language that is easy to debug (compared to javascript), I can use the same code in server and client side (validations, model objects). With SWT I get nice looking GUI.
Even if it means requiring a plugin in the browser (or using a cli tool), if my application is an enterprise application, does it matter?
For webstart you need Java installed on the client. For Flex Flash. For Silverlight .Net. For other RIA platforms a JavaScript enabled browser. It is a lot of product politic in that question.
And Java is very intenting, because "all seems to be a nail". Of course one of the great advantages of Java: same language, same knowledge, same code on every platform or environment (server/client/middleware).
For enterprise internal use, no it does'nt matter at all. If your biz is on the internet the decison is much more complicated (or even you have to offer the same functionality in diferent platforms).
The only contra argument is that in a lot of cases it's impossible to force the clients of your rich client app to have Java runtime installed on their machines. Everything else is a matter of taste, already existing knowledge and experience.
I think that until now the perfect client technology simply does not exist. We were excited about ajax and then there is another "hot" technology like Adobe Air. What is the difference between these techs and the "old-fashion" client-server apps? My friends we are back to the early 90s!
The AIR for example needs a runtime installed on the client machine, it has access to local system resources and communicates with the server using a binary protocol. On the other hand we are developing "RIA" applications (and very good ones :) using pure java swing clients communicating with the server through the Spring's binary remoting protocol. And i must say, in such a development life-cycle Java-Webstart is the winner. Especially in large-scale projects (and i mean laaaarge-scale, not just e-shops) in the java field i haven't found something more productive and maintainable (ah! maintainence... another big story) than this.
IMO if your users can live with a nice look-and-feel and you don't have to adopt another technology just because it is young and sexy use webstart. Put more work in your business model. After all enterprise apps is about business, not animations. And money is where the business is ;)
Yes I think it does matter, seeing that some big companies still have IE6 as their standard browser and as a requirement for web based applications. And those won't allow you to install any third party plugins into their dinosaur browser.
And you don't make a difference between RIA technologies that use existing browser technologies like JavaScript, CSS and HTML (including GWT which just generates client side JavaScript and ExtJS which is just a JavaScript Component library) and the ones that require an additional runtime environment (Flash, Flex or client side ).
Of course some things are easier to accomplish with proprietary or third party solutions (or you just have more knowledge in one of these platforms), but I still think that there is a huge potential in technologies that are standardized and already implemented in every modern browser (the differences between the browsers are slowly but steadily getting better, too).
If you ship it as a 3rd party application you can define a JRE as a System requirement, anyway but then instead of JavaWeb Start ship it as a normal Java Application as well.
Has anyone had experience taking a full-fledged Java desktop application and replicating the functionality using Flex?
If you have, what are some of the biggest things to watch out for or pay attention to?
What are some recommendations you can make based on your experience?
There could be any number of issues to watch out for. Here's a few that just come to the top of my head:
Flash Player restrictions that do not exist in the JVM, such as the ability to reach "outside" of the Player's bounds rectangle (and myriad others).
ActionScript 3 has no equivalent of java.lang.reflect.Proxy, unfortunately. This means that (so far) there are no decent mock object frameworks, and limitations with respect to reflection in general.
I am not aware of any AOP capabilities on the order of what you will find in Java.
Whether or not the Java application is using libraries that have no equivalent in Flex and which you do not wish to write yourself.
Java applications can call out to native code with the JNI, whereas this is not yet possible with the Flash Player.
Even if by "Flex" you include the Adobe AIR platform, the environment tends to be much more restricted in general than the JVM. However, don't let that discourage you - you get a lot of benefits from using Flex, such as an ubiquitous runtime, a great language and component development framework, etc. If your Java desktop application is an RIA, then Flex is probably a good candidate for a port.
I'm not sure if replacing a full-fledged Java desktop application with Flex is the best alternative. From Adobe Flex page: Flex is a highly productive, free open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops, and operating systems.
Adobe AIR is probably a better replacement for desktop applications, if you're considering Adobe realms of products.
I need to implement webservices in an upcoming project and wanted to know what are the main points to base the decision on whether to implement using java or .NET
I'm a C++er...
If you're a Java shop use Java. If you're a .NET shop use .NET.
There really is no difference that makes one of the two languages superior to the other in regards to web services.
Possible consideration - .NET pre 3.5 only provided support for SOAP based services, but I believe the 3.5 WCF offers REST and SOAP now.
There's no real difference from programmer's point of view (implementation).
For me, a reason to pick Java is that all tools and infrastructure are free/open source. OS, deployment web server, databases, IDEs and developer tools.
I have plenty of experience with both, and both will certainly do the job.
However I tend to prefer Java over .Net for things like web services for the following reasons:
It's cross-platform, which gives you much better options on the hosting side (e.g. running a big Linux cluster on Amazon EC2)
The library ecosystem is larger and more mature, especially on the server side.
I prefer the more flexible open source philosophy to "the only way is Microsoft". Vendor lock-in is always a bad idea for your enterprise architecture in the long run.
You can optionally use awesome languages like Clojure or Scala on the JVM
Ultimately though, I'd go with the one your team has the most skills with. This will determine what you are most productive with, which is usually most important if your main objective is to deliver value quickly.
It's a personal decision, usually determined by the technology already in place or the skill set of the developer(s) writing the services.
i've never really developed web services in java, but i have in .NET and if you're using Visual Studio they're an absolute cinch to whip up (i expect they're a little more difficult to do without the aid of VS).
if you're already working in java, and don't have any .NET stuff in place, stick with java - it'll save you a lot of money (if you were to get Visual Studio in, as i mentioned), and possibly some time involved in learning the specifics of .NET
In my experience, Web Services are a bit more tightly integrated into Visual Studio than they are into Java's editors.
The Eclipse IDE doesn't even have JAX-WS (Java standard web services stack) support built in, opting to use Apache Axis 1 instead.
Netbeans supports JAX-WS, though.
I personally prefer .NET to Java for many reasons I don't want to go through, since it doesn't really matter and is more a personal preference than a strict guideline I can recommend.
If you have Java infrastructure in place or using a platform other than Windows for your server applications, I strongly suggest Java. However, if you don't have anything in place and running on Windows platform, .NET is pretty cool in that area (WCF/ASMX/WSE/...).
As you say you're a C++ - er you'll probably find .NET easier as you can target it directly from C++.
I'm a Java guy, but I think Web Services are easier to code in .NET. Visual Studio takes care of everything, in Java it takes a bit to get started.
A bit of a problem in some projects with JAX-WS is, that SUN ships the "old" version 2.0 with Java 6. If you want to use the current version, it's some work to make it run with Java 5 and Java 6.
If your app must be portable, you should obviously choose Java. Otherwise I would say it's just a choice of your preferred language, since the above issues are really small (maybe you want to choose Axis or something else anyway, I haven't worked with something other than JAX-WS yet).
IMO if you want to do SOAP, then its a heck of a lot easier to use .NET and WCF. However, I've found REST to be a bit tricky with WCF, and had to implement a custom XML parser to do it instead of using their built-in one.
You probably want to consider your hosting environment too. If you are going to serve this from Windows hardware, you can drop .NET WCF web services into IIS. If you are going to run a Linux/Solaris server, then it isn't even a question...
I suggest implementation with JSP ,it provides a robust platform for development
I prefer JSP to ASP or any microsoft techonolgy!