Java as back-end platform. Good choice? [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
My company is about to start building the back-end for one of our new products. The idea is to build a layer that produces resources for every upper layer product (web site, mobile web site, mobile application), also, a significant part of it will be made available as an API for third party developers. You know, the typical start-up scenario.
We were planning on building our backend using Java Servlet Technology so our architecture was going to be dependant on Java, so the question is: What are the implications of Oracle scaring away open-source-aware developers and companies like mine?
Should I try to find an alternative to Java? Are you trying to move away from Java?
This question is not about technical issues with Java platform, but with legal implications of Oracle draconian intentions (my subjective point of view).
EDIT: Of course this question is subjective and argumentative, that's the kind of answer I want: opinions, and opinions are subjective and argumentative.

I suspect that Java will remain a strong back=end platform for a long time. Oracle, among other things, doesn't want to kill the golden goose. In addition, there are too many good back-end components based on Java, from Tomcat to messaging, to hibernate and spring, to groovy and grails; the market won't let them disappear for a long time.
Technically, Java is well suited for complicated back ends and large-scale problems; if you're building something simple and lightweight, using a framework like Rails along with an open-source database is often plenty.
Groovy and grails are a nice bridge from the lightweight approach of Rails to the full Java world, although groovy can be a little, um, peculiar sometimes.

We were planning on building our
backend using Java Servlet Technology
so our architecture was going to be
dependant on Java, so the question is:
What are the implications of Oracle scaring away open-source-aware
developers and companies like mine?
Are they? Last time I checked JBoss and Spring were going strong. Scala is being considered as a strong alternative for replacing Java (or it will shape the next best language for app/system development on the JVM.)
What exactly are you referring to here? I don't follow. Now, if you are going in direct competition to Oracle and their stack (and all their integrated solutions, like Oracle Financials), then maybe you might have something to worry about.
Or if you are (or intend on) doing something that violate (or can be interpreted as a violation in a court of law) the Java license agreements, then you might have to worry about Oracle (because it has the teeth to pursue them, which Sun did have.)
So, you need to be a bit more pragmatic and objective and define clearly what exactly your product role will be with respect to Oracle products. Based on that, you have then to decide whether investing on the JVM is a good decision or not.
Should I try to find an alternative to
Java?
Depends on what you are trying to achieve. A question like that is too broad and open ended to be answered in a meaningful manner.
Are you trying to move away from Java?
From the point of view of curiosity and diversifying my skills, yes. But were I in charge of developing a back-end product, I'd use the JVM. I might try to use Java and leverage from the 15 years of collective knowledge on the platform. Or I'd try Scala. But I would stick to the JVM.
Oracle or no Oracle, for these type of things, the JVM is the superior choice in terms of stability, scalability and wealth of knowledge. Erlang VM might be better from a technical point of view, but you would be hard press to build a talented team compared to building a similar one for the JVM.

Found an article discussing the future of Java, dated 05.03.10.
Okay, conclusion from the same link,
While the wheeling and dealing of the
corporate world rarely affect
developer communities as a whole, the
Oracle acquisition of Sun will have
far-reaching affects for years to
come. And while the profitability of
individual Oracle products may not
concern you, as a developer, the most
interesting points remain to be the:
- Combination of HotSpot and JRockit into an uber-JVM
- Unification of the Java SE and Java ME APIs
- Increased investment in JavaFX onto more platforms
- Continued integration of dynamic languages into the JVM.

I would recommend Java as a back end platform, I am currently employed with a company that specializes in software business solutions for companies, and nearly all of our work is revolved around using Java in the back end.
I am not sure if your back end is going to be web driven or not. I would say take a look at using the Spring Framework with Hibernate Database support. Spring has excellent support for using Hibernate and so many other tools and thats why I am a supporter of it. Unlike some other frameworks that limit you to using only certain tools, Spring does a great job of allowing you to integrate many different libraries, tools and frameworks with it. This is good because as we know too well, technology is always changing and something that is popular now, may need to be changed in the future.
Java as a back end solution will require a little more work in the beginning as oppose to lightweight approaches like Rails, but once you get everything setup(database,build files,etc) then it is off to the races.
If you end up taking the Java route, look into using Maven for building. Ant is also good, just a little more work to setup.

... did you rule out any particular technologies and for what reasons? Is .Net an option?

Related

Is Java is an "island" for developing new apps and libraries? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I will be making a cross-platform, graphical mathematical modeling application, for example, a user can drop a bunch of nodes on a canvas, specify some mathematical relationships between them, and run a simulation. I'm also interested in seeing in this being a web app.
I have had some programming experience in Java, MATLAB, Python, but I have never made a large application, thus I know very little about software architecture, and how multiple languages work together.
I am trying to figure out the best IDE, language(s), etc., to work in. The previous work done by my group has a lot of C/C++ libraries to draw from for back-end work, like simulation. I was told by my boss that Java is an "island" for development, meaning the Java app has difficulty using libraries from other languages and making its own libraries usable to other languages.
Is this true? Can someone shed some light on this topic?
Also, then what tools should I be using? I am ready to learn anything, but I'm trying to go for what would be the most productive route. Learning and then programming everything in C/C++ does not seem like a very productive route to me currently.
Things I've looked at so far include WindowBuilder/GWT Designer (this seems like a way to make both desktop and web apps), Mono/GTK+/MonoDevelop, and Delphi
Please feel free to be as verbose as you can, thanks!
I fear this post may get closed as off-topic. But it seems a little too specific to toss, IMHO.
Java interoperates with a lot of non-Java projects, products, etc. However, a major feature of it is portability, so you'll find that folks go out of their way to stay within the JVM environment. In that sense it's an "island".
I suggest you think about exactly what you want to interoperate with and get specific - see whether the hooks are there or not.
For your back-end C/C++ libraries, you'll need to implement JNI interfaces. I'd describe this as having a small but moderately steep learning curve - not a lot to learn, but it takes a little thought - especially if the amount of data passed back and forth is so large that performance is an issue.
You may find that you don't have what you need with GWT for the graphical aspects of what you're doing.
I'd think hard about how much you need the web aspect. If you do, consider skipping a desktop-only solution (and maybe Java/GWT) altogether, and just going to the web. This is especially viable if you don't need to support older browsers.
I'm not going to touch the "what tools" question - it's too broad.
Considering Jython, Groovy, Clojure, and a whole host of other language adaptations for Java, I would firmly suggest that your boss does not know what he is talking about. Java also has the ability to execute native code if necessary, so it is not terribly difficult to incorporate other, non-JVM toolkits. But even if he were right and there was no cross-linguistic work with Java, the language has been around long enough, and it is verbose enough, that you can generally find libraries which will supply the inter-operability you're looking for.
Without knowing more about your specifics it will be hard to give a precise answer, but the general rule is that the language you know is better than the language you don't, so unless your language goes completely against the idioms required, use it. Eg. if you have in-house expertise in C/C++, those languages are perfectly adequate for building applications. JavaScript significantly less so.
You do not want bugs which are caused by faulty assumptions about the language. Those are nearly impossible to track, especially since you won't know where to look.
Well, if cross platform is an issue, I would suggest developing in Java, it makes everything very easy in that regard. As far as loading C/C++ libraries, I don't have much experience with it, but I would recommend taking a look at something like Java Native Access.
As far as tools go, they are wide and varied. I personally use Netbeans or Eclipse, but untimely that sort of choice comes down to what plugins you may need and what you personally prefer.
All in all, I would say program out a little stub of the application in different environments and different languages and see what you like. You really need to know the details of the application to make an informed decision, and it varies in most cases. Best of luck!

Choosing a java web framework 2011 [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
My question is based on the following question: Choosing a Java Web Framework now?
..only one year later.
The reason for my question is that plenty has happened in one year, play framework has matured etc., and I want to know whats the hot thing today. What are the advantages and disadvantages of todays frameworks.
focusing on Java frameworks, it depends on your aim (as everything in IT!)
On products for big companies, you either go with Java EE or the standard Struts/Spring/Hibernate. They are proven stacks, the scalability needs in that environment are meet by those stacks and being stateful can be relevant in that environment. Besides, they apply a new version of "No one was fired by buying IBM" with the apps (Play, Scala, what's that?)
For your personal projects, no commercial aim, just or fun, any framework you like. Lift, Play, whatever.
For a startup, I would recommend either Lift or Play. I personally like Play more, but YMMV. Both are agile frameworks that simplify development and give a quick turnaround. Perfect match for a startup. The differences (stateless vs stateful, etc) are what you should check before deciding.
On Scala vs Java, again it depends. Unless you are lucky, you won't be allowed to use Scala in a corporate environment (slowly being spread though). For your own project, it doesn't matter. For startup, choose the one you know the best. I know, learning is appealing, but if you have 6 months experience as hobbyist in Scala and 5 years of commercial Java experience, the time and pain on creating your project in Scala won't be worth it.
JSP is a legacy tech, JSF is like a dinosaur, it's stateful and component based. If you want to develop high traffic distributed apps that can scale tens, hundreds, thousands of nodes, prefer stateless frameworks over component based stateful ones. Stateless frameworks can scale easily. Wicket, Tapestry and Lift are stateful, too. There is Click framework but it doesn't have an innovation nor velocity. Struts was good but it's an old framework now, Spring mvc 3 is better than struts. Yes, Spring mvc was good, but now there is much more better Play! Spring become like Java EE in time, on the other hand Play is dead easy framework with a great community and documantation. It's future is bright. It has lots of features in the core (and its very light) and also there are lots of modules written for play (like rails gems). In the last release, it got websockets, depenency management, db version management, far better scala module,...
Especially, new play scala templating is dead easy, type safe with a state of art syntax (like asp.net mvc razor) with a great performance as you can see in the test http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp/ (play is fastest in the test)
You can use both java and scala with play, but in my opinion scala is a better language than java and compete with C#, Ruby, Python with new generation features (java cannot), so I prefer scala with play. Lift is a scala framework, too, but it's more and more complicated than play and highly stateful.
Also, your platform and language selection is great. As an experienced .net developer I don't recommend asp.net webforms nor asp.net mvc, always prefer platform independent open source technologies. Python/Django and Ruby/Rails are slow and not type safe. PHP and Perl are legacy techs. The best platform today is jvm (.net works only on windows and mono killed by attachmate), so you're on the right path.

Struts vs Zend ? Java vs PHP? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know it's a hot question that need anwsers ^^
From my viewpoint, using Java vs PHP, is nowadays a problem of system resources (Hardware, Software, etc.).
For Java, you have to deploy J2EE Stack (JDK, AppServer, etc.) (~200M) on your server, for PHP you need to deploy a LAMP system (~100M).
Using Java was in my opinion due to object oriented programming in web application, but today we have a lot of Object Oriented Web Language (Ruby, Python, PHP).
So the question when to choose between Java or PHP for new projects ? Maybe the community difference ?
I know that stackoverflow is not made for discussion, but it's a (good?) question that need answers (for me and for others maybe) ^^.
What are you guys talking about....
Okay JAVA has some pros, but it also has some cons. Now with PHP it is exactly the same, it has some pros, but it also has some cons.
People who say PHP doesn't have a good OO environment, well either does javascript! And really that is the heart of all web 2.0 projects; javascript. The back end today is becoming more of a resource for the front end. What you can do in JAVA now days you can do in PHP 5.3 - to some degree. If you are a good developer you will be clever enough to abstract your design to make it maintainable and if you are brillant you can match and even improve object sharing in PHP, which majority of web "designers" don't know about - or dare I say, comprehend. Check this article out by O'Reilly ON JAVA!.
I develop both in Java and PHP. I'll always use PHP for my server side and I'll use Java for Android Development, and desktop development. (By the way I have developed in java for backend development, but it take twice as long to do something in JAVA then to do it in PHP. That is why I stick to PHP.
I hear this spagetti code problem with PHP all the time. Yeah. Maybe 5 years ago! If you project ends up like this then the person, or you, is a poor programer, and you should stick to drawing pretty pictures. It is easy to separate your logic from presentation, and it is also simple to separate your business logic from you data layer. Think before you code. Don't just open up a note pad and start typing. Plan! People who fail to plan, plan to fail! Jacco you're on the money!
I see uni students all the time building code where I think, "The person who is going to end up with this guy is going to regret it". If the student just planed and documented what he was going to do then every thing would be organised and ready for scaling - again if he was good enough.
Both technologies are great and you should use what is more comfortable to you or your developers. If you go down the road where you think one is better than the other and you know nothing about that technology, well guess what? No matter what you do your projects outcome will be missed, and you'll end up having to do it again.
Other constraints are usually taken into account. Things like
development time,
maintainance cost of the codebase
availability of qualified programmers
salary cost for available qualified programmers
to name a few.
Hardware and software are cheap if you compare them to the above so they tend to be less important.
I did a non-scientific performance comparison of J2EE and PHP. The comparision was to see the user experience of each system under various load conditions.
I found that PHP's response time was very slow and CPU maxed out very quickly. I understand there are some compilers that will probably help, but I wanted to make an out of the box comparison of performance of rapid development systems.
You can read the full details here: PHP vs J2EE: a Practical Approach
It depends on what you're doing. Choosing a language/framework without analyzing your project requirements is a bad idea.
Choosing a language depends on what you want to do, But I am very sure that the different hard disk space requirement will be the least important aspect of your decision.
Here is a possible hint: If you want to reuse your work (or parts of it) in a desktop application, Use Java. PHP is virtually non-existent for everything except web programming.
I really don't think that it is a question that can objectively be answered. In the end it is about people and what they feel more comfortable with. That is why e.g. Facebook developed a PHP to C++ compiler (with which the performance benefit that Java has might become smaller, too) instead of just hiring C++ developers for doing the Job.
On the other hand, the Java platform offers some interesting new approaches like Grails (which is basically a Groovy Wrapper around Spring) and Lift, as well. That makes Frontend development faster and easier (I still find that this is a real pain with plain Java) and you can combine the benefits that other languages have with your existing Java codebase and expertise (btw. most of the Frameworks mentioned don't need a J2EE runtime environment a simple Tomcat installation with around 5M and an installed JRE should be enough). So it is not really about the Java programming language alone anymore.
And if you really can't decide at all you just run PHP in Java (works as well for Ruby, Python, Javascript ...).
PHP wins in front end in web development. Because it has much smaller development time which make things cheaper and cheaper.
PHP will lose in mobile app development. There is no way to develop a mobile app front end with PHP. And Because its performance gap with java and other static languages, PHP will lose the back end battle. Java is old, but it has a pretty young and professional community. Check out those names: lucene, weka, hadoop,scala,cassandra, hbase, what does php provide us in back end service???????
I do not really agree on the fact that the choice of a language is related to system resources.
Hardware is cheap and we are not in a time where we need to closely look at the system resources as we used to have. Don't misunderstand me: we still do need to pay attention, but the time where people were xoring their pointers to save some space is over (luckilly).
And if your main concern is performance, then either running a JVM or an interpreted language is probably not the best option.
I do not think it is related to the orientation of the language per se either. Ok, I know, PHP is not object oriented but still, you can now code OO with it. You will find descent web frameworks for almost any language.
I agree with Jacco on his list.
Another aspect is indeed the culture the language refers to.
PHP is for script kiddies. Java is for serious, wearing suits business developers. Of course, we all have many counter examples but still. Java was largely adopted by big companies, now competited by .Net. There are good reasons for this, among which the fact that it a lot easier to write poor code in PHP than in Java (and almost any other language). On the other hand, Java is not exactly freedom oriented.
If your project is strictly personal, you can choose whatever suits your tastes better. If you plan to develop as a team, the choice of the language will impact its general mood/way of thinking.
I would finally add some important parameters to me: fun and elegance
This may be a matter of taste here again, but I have much more fun coding in python than in C# for instance.

When is Java the right choice for Web-based applications [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been doing some research into taking my programming experience and moving into the java programming marketplace, due to a combination of personal interest and local market forces. As you can gather from the title, the vast majority of my experience has been in building web-based sites and applications, and I'd like to move as much of my previous experience as possible.
One thing that I've been unable to find a concrete answer for when should a website or web-based application designer look to going with a Java based solution, over other options currently on the market. What options would Java provide that would have a designer select Java as the basic coding language to base a project upon?
Thank you for any constructive replies that may arrive from this inquiry.
EDIT: I should have included the caveat of if other factors are equal, for example if hardware, software, developer skill in java is up to where they should be for such projects, and so forth.
The main factor is what your developers are adept in. If you've got a bunch of Java developers, go with Java.
Consider this also: Java tends to run on app servers where there is a persistent global program running, and separate threads/processes spawn off to service individual requests. However, if the main global VM croaks for some reason, your whole app can go down. The benefit of course is that you get application/system level resources that you can initialize and use continuously across all requests
Other environments like PHP basically tear down and rebuild the entire environment for each request. You can code in application level data persistence using a database, but you don't get it for free. On the other hand, if one php process croaks while processing app data, it won't kill the whole system , as the entire environment is just torn down/rebuilt for the next request.
Agreed with many of the previous posters, but one possible consideration is runtime speed.
If you are using a very basic LAMP stack server, running PHP4 or lower, Python or Perl, if you do not set pre-compilation, all of your scripts will have to be re-compiled at runtime. This can cause immense stress on the server for high intensity applications. If you're in the situation where you cannot enable pre-compiling for LAMP, but you can for Java (most Java servers require this), then this should be of concern. The disadvantage is that you may have to re-compile large chunks of your web application every time you edit it. I realize this is becoming less and less of an issue nowadays, but its something to check.
Be sure to include a learning curve in the development time if developers aren't familiar with the chosen language.
For the most part, the best technology is the one you are already using.
If you have coders that know java, have system administrators that can configure java apps and know what to do when a java app stops working, and project managers who know how to accurately schedule and plan a java deployment, you would need a very, very compelling reason to pick something else like .NET for a new project, even if .NET is "better" (whatever that means).
There are, of course, exceptions; if you're using something obsolete and/or is not going to be supported in the future (like classic ASP), or you have no legacy systems, then it's time to use something new.
I believe that the conventional wisdom on this subject is that Java is better suited to very large systems that need the discipline of static typing. Also, on very busy sites, Java can use less memory and run faster than most interpreters.
(Right out of the box, Java wants lots of memory. But on a busy system Java has only one copy of all running code.)
There are also certain prosaic reasons to stick with Java, for specific sites. They might need back-office integration or some other big piece of existing code.
I would use Java if there was a library or framework that provided specific features that no other language did (or not as well).
For example, if I had an in-house-built java library for running our Gruntmaster rock crusher, then it naturally would make sense to use Java to build an app that needed to control the Gruntmaster.
Some might say that whatever one's shop's official language is the language one should use--I disagree with that rule, as in my experience a good developer can learn any language.
There is no hard and fast rule otherwise; each language has its own strengths and weaknesses. The fact that you are asking this question about Java tells me that you are not as familiar with it.
I'd suggest you go ahead and build an app or three in Java -- then you'll know. :)
There is very little separation between the capabilities of the various technologies available today for web programming.
Java at one time was the default choice since it far surpassed the abilities of the competing technologies, but that is no longer true.
The Microsoft answer has matured rapidly; the days of classic ASP are far gone with .Net now providing all the abilities and ease of programming that Java has offered.
New languages such as PHP and Ruby have arrived or become much more mainstream, and are also valid choices based on your programming needs.
So as many others are saying it boils down to what language you or your developers are familiar with.
Another aspect to consider, is the ability to use a vast eco-system of open source libraries.
Languages like PHP, Perl or Ruby have such lib market places (almost) built in. .Net is rather closed in that sense. Java on the other hand has a a very large, enterprise grade eco-system of libraries to choose from and communities to learn from as well.
Practically I agree with the guys about leveraging existing human infrastructure.
Technologically, Java is quite good for non-standard web things - like heavy use of AJAX (GWT, DWR, Comet spring to mind), Mobile (where you generally need lots of session data and less front-end bling), really simple things that are going to be put under immense load (it will definitely trounce Apache mod_XXX every time, the only thing faster in wide-spread use is native code).

Why is Java frequently used for enterprise applications? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
As a Java newbie I'm wondering: of all the languages in the world, why is Java frequently used for enterprise applications? What makes it that way compared to the other languages? Will it continue to be this way in the upcoming years?
I'd appreciate your insights. Thanks in advance :)
One word: libraries. Java has an vast array of excellent libraries for solving most of the common problems one needs to solve when developing enterprise applications. In many cases, there is more than one good choice for addressing a particular need, and oftentimes those libraries are free and open source under a business-friendly license.
Some have argued that there are, in fact, too many choices in the Java ecosystem, and that developing enterprise software in Java requires developers to make a large number of decisions that can have far-reaching impact on the end product for better or worse. This has probably helped propel the popularity of alternatives like .NET, which has a reputation of offering fewer choices, but with the benefits of a more well-integrated application stack and tools set. What direction you choose depends, I guess, on whether you place more value on "freedom of choice" or "freedom from choice".
There are lots of reasons a large company (the type to go for enterprise solutions) would pick Java. Note I'm not saying all these reasons are correct or valid. But the relevant point is that they appear valid to a CTO at MegaCorp.
Learning Curve
Java is a simple language without much of the flexibility of other members of the C family, this cuts both ways, but it is seen as a straightforward language for use by an army of programmers. Enterprise projects tend to involve large numbers of developers (rightly or wrongly) and it is much easier to get a developer to a minimum level of competence in Java than C++. You also have a whole generation of graduates who have probably been largely schooled in Java.
Choice
Java has a vast array of libraries, frameworks, tools and IDEs, and server providers. To an enterprise its good to have choice, even if that's just for use as a bargaining chip when negotiating price. The language lends itself to code quality tools that allow enforcement of corporate standards (and as mentioned there are a lot of those tools).
Platform Independence
Java is write once, run (well, debug) everywhere. Sun has actively encouraged open standards that allow multiple vendors to implement their solutions. These standards give the customer the comfort that they can migrate from one vendor to another if a given vendor goes under or starts charging more. Of course the reality is that each vendor does their best to provide some "added value" features that tie the customer to them quite nicely.
Maturity
Its been around a long time, running a lot of servers. If your web application needs to be "6 sigma" or similar and you are the MegaCorp CTO, you are not going to look that kindly on Joe the developer wanting to do it in RoR.
Timing/Marketing
Java came out when programming was moving towards the web. It was positioned cleverly and got a strong position early in web development. Because of the open standards, there are some very big companies producing these platforms and they market Java pretty hard to sell those platforms.
Inertia
Large corporations move forward at a glacial pace (a lot are still using Java 1.4 five years after 5 was released), so once they've picked Java, it takes a massive investment to move to another platform. With each day that goes by they're cranking out more Java that would need to be migrated. Most of these companies are not primarily coding shops, so it is a very hard sell to convince the business to spend a few tens of millions rewriting their entire code base for no immediate business benefit.
Another reason might be the care Sun has taken to keep Java backwards compatible. The vast majority of Java code can be run on the latest version of the JVM without a problem. That is quite an achievement, given the age of Java. On the other hand you might argue Java has not changed all that much in all these years.
Enterprises like stability in a platform.
Sun targeted Java to speak to the needs of enterprises early on. It pushes standards that promote vendor independance at every level. Platform independant, database independant, application server independant, etc.
In addition they promoted enterprise level tools for it, in terms of messaging, transaction management and other things that the enterpise worries about.
Before Java, enterprise level stuff tended to be done in C++ (there were plenty of exceptions (does anyone remember PowerBuilder?) but that was the rule) and Java fits well as a successor to C++ for business applications, where that kind of memory management isn't something worth paying for.
In addition to all of that the language itself speaks to enterprises in terms of avoiding hard-to-get-right constructs that can really mess up a code base, such as operator overloading. Enterprise level applications tend to get handled by many different hands, not all of which are the top of the line programmers, and having safty nets to prevent shooting themselves in the foot is a desirable thing.
It also came along at the right time. A new paradigm (this was well before .NET existed) that promissed to combine multiple vendors into an ability to compete with Microsoft, which got the likes of IBM and Oracle on board, that happened to fill a new hole, which was the emerging requirement to develop web applications, where C++ was no longer an obvious choice.
I shouldn't be saying this, but...
The real reason is because it's named after coffee!
Business is about time, money and opportunity.
Using Java means that your number of errors in the code goes down, simply because pointers are hard. You use a GC and you instantly remove an entire class of errors from your code.
Secondly, Java was one of the first languages to ship with a pre written library of functions, which really did cover a lot of the development phase. This restricted the way things were done but it meant that people could learn faster, had more tools at their disposal and had a great set of libraries to do things like network, GUI, web, encryption etc. Java on its own as a language really wasn't that special, but Java plus the Java API was.
So if you've got a language that has less errors and more infrastructure for free, then you end up with more code in less time. Sure the code doesn't cure cancer, it's not as fast as C++ code to achieve the same task, but it will achieve the business' goal of getting an application.
If you make more code, for less money, you can pursue more opportunities. You then bring inertia to the table in terms of code that's already been implemented in Java and you start seeing why the business doesn't want to move away from their comfort zone.
Personally I believe one major reason is the cross-platform issue.
Java programs written "correctly" (without assumptions of the underlying operating system) can run on any JVM. This means that you are not tied to a particular platform, unlike .NET which marries you to Windows.
I have seen Java code run on mainframes, Linux routers, inside Oracle database, and naturally on PC's.
It's cheap, RAD, cross-platform, and developers abound.
Developing in C++ is too slow and expensive and .NET has not been around for long enough. Business inertia is huge, remember.
Businesses want languages that are backed by a professional provider (ie. a company like Sun) and often stay away from Open Source languages for the simple reason that it was not written by a company.
Also for client-server applications, you have an abundance of choices for production-quality app servers that have the same J2EE interface (IBM WebSphere, BEA Weblogic, JBoss). Alternatively, you could use the Spring Framework on any server like Apache Tomcat the complies to the Servlet API if you're convinced you don't need EJBs. In contrast to .NET, it's hard to find choices with respect to app servers.
There are an abundance of choices with regards to frameworks for a given task be it an ORM tool, logging, collections, caching, web UIs, etc. There is no hardly any need to reinvent the wheel.
Finally, while it's fashionable these days to lament the very real shortcomings of Java the language, it's a language where folks know how to get things done and how to avoid certain anti-patterns.
The other answers are all good. Two things need to be added, corporate standards and the bandwagon effect. If you want to build an enterprise system you need to have pretty strong case for not using your company's entrenched standards and this is mostly JavaEE. And if you need to resource a project it is a lot easier to recruit a Java programmer than it is, say, Erlang.

Categories

Resources