Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 972
Simon P Avatar asked Apr 25 '09 04:04

Simon P


People also ask

Why is Java used in servers?

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#/.

Why Java is more used than C?

Java is also common for web and desktop apps as well as applications that run on servers. Java is more widely known and versatile, so it's also easier to find a Java developer than a “harder” language such as C++. Overall, C++ can be used for almost anything, but it's not always necessary to use it.

Should I use C or Java?

Java is an object-oriented, high level, and interpreted language. Java uses objects, while C uses functions. Java is easier to learn and use because it's high level, while C can do more and perform faster because it's closer to machine code.

Is Java used for server-side programming?

A growing number of servers support server-side Java, including the Netscape FastTrack 2.0 and Enterprise 2.0 servers, JavaSoft's Java Web Server (formerly called Jeeves), the World Wide Web Consortium's Jigsaw, WebLogic's T3Server, Oracle's Webserver, and Peak Technologies' ExpressO.


3 Answers

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.

like image 101
Elliot Kroo Avatar answered Oct 27 '22 01:10

Elliot Kroo


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!)

like image 37
itowlson Avatar answered Oct 27 '22 01:10

itowlson


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.

like image 35
justinhj Avatar answered Oct 27 '22 00:10

justinhj