Simon P
Simon P

Reputation: 1216

Why is Java on Server and C# on Client a popular choice?

I have seen a few examples where the architecture is that there is java on the server side and c# on the client - what makes this combination so good? why would .net on both sides not be a better choice (or in fact, java on both sides?)

added later: in lots of cases, the java is hosted on a windows server itself, i think via tomcat (not 100% sure) - what's the motivation here?

Upvotes: 8

Views: 5958

Answers (8)

On the server side Java has proven to be robust and scalable and it is available on platforms that .NET can only dream about. Hence if you want the most choices in hardware Java is an excellent choice - this includes very large machines with many CPU's as well as lots of clustered cheap x86 boxes.

If you have .NET on the server side you must use Windows, and Windows simply doesn't scale well hardware wise.

Upvotes: 1

Fortyrunner, I haven't seen a single benchmark where a hotspot JVM will beat MS CLR.

Upvotes: 0

Fortyrunner
Fortyrunner

Reputation: 12782

As far as Java is concerned two things

  1. Linux. Its reliable and cheap. One of the many reasons enterprises use a lot of Linux for Java because they don't have to reboot boxes after Patch Tuesday.
  2. Hotspot. Its one of the wonders of the modern world - amazing performance.

Upvotes: 0

Marc Gravell
Marc Gravell

Reputation: 1062945

Most servers are either Windows or *nix based. So at the server, either Java or .NET/C# (via mono on *nix) would be perfectly good.

Java has better support for different client devices, but in many ways that requirement is being replaces by the much better HTML support at most clients - at least for online devices.

For a installed client application, then arguably Java has the better portability - but with things like Compact Framework, Micro Framework, Silverlight, etc .NET is catching up.

Personally (due to job role), I care mainly what is at the server; .NET/C# has never let me down - but I'm not a Java developer, so I can't contrast directly. From work on open source projects I know there is a good community of people out there using mono on the server.

At the client, tools like WPF offer a first rate GUI experience, with .NET's support for winforms being useful for regular windows apps. But since a lot of the WPF architectureis common with Silverlight (with Moonlight as the mono twin for *nix etc), this allows the experience to be used on non-Windows clients too.

Upvotes: 0

Peter Lawrey
Peter Lawrey

Reputation: 533530

Java is considered more mature, which is a good attribute for a server, whereas C# has better integration with/similar look and feel to windows and office (which the clients like)

Upvotes: 2

Elliot Kroo
Elliot Kroo

Reputation: 4543

Java is frequently used on the back-end (and has become the de-facto standard) for a number of reasons:

  • Java can run on various operating systems transparently, from Windows development workstations to dedicated unix servers.
  • Java enforces a modular, object-oriented approach to coding, which allows for large-scale systems to be written (hopefully) without becoming unmanageable. (this is also true of C#/.NET, but not true of other back-end languages such as Perl or Python)
  • Java is frequently used in back-end systems (the more popular a language is for a particular application, the likelier it is that there are mature libraries and tools in that language for that particular application)

C# has great tools and libraries for designing UIs in Windows. Java's operating system (OS)-independent nature provides fewer tools for the particular quirks of an OS's UI, whereas C# is designed and maintained by Microsoft, for the purpose of writing Windows applications.

Upvotes: 19

itowlson
itowlson

Reputation: 74802

Well, there are a lot of cases where .NET is used at both ends (and I would guess ditto for Java). But my guess for the motivation behind Java-server/.NET-client architectures is that the application is targeting Unix as the server OS, either for cost or reliability reasons, or because it needs to fit into an existing Unix server environment (e.g. working closely with existing Unix apps), but is targeting Windows as the client platform. (I think Java is probably much less common where Windows is also being used as the server platform; no figures to back this up though.)

If a Unix server OS is assumed, then Java is a very productive choice, well supported with lots of libraries but with a larger developer base (at least in "enterprisey" environments), and more "management" recognition, than alternatives such as Perl, Ruby or Python.

Conversely, .NET is the better fit for the Windows client, because it has much better support for building Windows GUIs. It's not just the tooling: the Java GUI APIs themselves (e.g. Swing) tend to prefer cross-platform similarity over a native look and feel, and therefore tend to result in apps that don't look or behave like Windows applications. (I am generalising a bit here -- sorry!)

Upvotes: 5

justinhj
justinhj

Reputation: 11306

Data interchange formats like JSON make it far less important that the systems on either side of the connection are the same low level technology.

Java is a very well tested and supported language for servers, whilst C# has great tools for building GUI's.

Upvotes: 3

Related Questions