Sunday, October 24, 2004

Comparing .NET with Java 1.5

In response of my .NET vs Java 1.5 mail, our guru MVP Khurram Shakir made a few interesting points. This blog entry is my response to his mail ......

I also have a few points to make, please correct me if am wrong.

This discussion i belive is very important for all of us and this is not about a war between Java and .NET ... its just a comparison between technologies and tools available for us to use. We as programmers/ s/w engineers /(any thing else you can think of) use these technologies/tools as and when they are useful and "appropriate" for us. So in some sense we ought to be technology/tool independent to be more effective and useful to our organizations.

Now getting back to the discussion:

1- Language Design:
I personally believe Language design is one of the important considerations. If that wont be the case people wont love/like a particular language over the other. I mean alghough VB is a great tool, but I never really liked it as a programming language. (what do you say?). In this context I believe C# is a beautiful language, if not better then atleast as good as Java.

2- Persistence Frameworks:
NHibernate is being developed and it is in its Alpha release at the moment. I am my self unsure about ObjectSpaces. So this thing might be lacking with .NET, I agree. But, tell me what is the cost that we have to pay for these Object-Relational Mappings, you bet, its performance. Also from design point of view i have asked a lot gurus about this Object Relational Mappings, these ideas sound good when you have a stable data model and developing a small to mid-size application. Believe me for enterprise scale financial/ mission critical applications we simply are not looking for objects mapping table and helper classes for create, update, and retrieve functions. Sometimes when I have to initiate a business process flow (lets say by performing a transaction), the data that I require may not typically be mapped using Obect Relational mapping, because what I am trying to abstract is a process and it has its own state and its db status corresponds to and spans across multiple tables. I had this interesting reply from Clemens Vasters when i asked him about the same.

3- Custom Layout:
I completely agree with Khurram bhai that there is no such feature available for customizing layout. But with ASP.NET now we have Master Pages and themes that takes care of all such requirements, but still WinForms API is still lacking it.But as a work around either we can write generic event handlers (as in interceptors) that can dictate the look and feel of our forms. For even better, we can implement base class Forms with specific UI features (themes/layouts) and inherit our froms from them (i.e. Visual Inheritance)

4- UI/XML Mapping:
I will again agree with Khurram bhai that UI/XML mapping is som thing that is missing. We all will have to wait for XAML to get real.

I dont have experience of working with GDI+/ Java Imaging APIs so i cant comment on that.And for tools I believe Whidbey with its featurs like Team System, Visio Integration, Data base integration (drag drop features for SPs/ tables etc), Source Safe etc and all with its compoenent orientation stuff ... is a very powerful IDE. Havent seen eclipse 3.0 and JBuilder 2005 as yet so no comparison with them.

Thats all I had to say...

best regards,

khurram shakir wrote:
My few thoughs about Java 5.0 !!!
In general I am impressed with the features and quality of Java 5.0 !

Java 5.0 is now in production version, and .NET 2.0 will take at least
sixth month more to become production ready.

In general I am not much interested in language features of any of
these technologies, instead interested in the services they are

I found Java APIs are quite nicely design when compare to .NET APIs,
especially I am impressed with the availability of Java Persistence
frameworks like (JDO, OJB, Hibernate), The official counter part for
these frameworks are still missing in .NET (ObjectSpaces will ship in
2006, if it ever ship !).

Also for developing extensible UI applications, I found Swing APIs are
more flexible and feature rich(Although quite complex), e.g.
- WinForms has no official Custom Layout support (just one event for
which we have to do all layout stuff) and UI designing is heavily
dependent on Visual Studio IDE.
- Developing UI from XML based schema language is missing in .NET (may
be suppored in 2006, when XAML become part of Longhorn). Swing already
has Long term Persistance support (Xml based UI)

(I know there might some performance problems in Swing but I think
situation is change a lot in JDK 1.4 and now in Tiger)

Design wise I found Java 2D and Java Imaging APIs are more creative then GDI +.
There are few useful utility clases are still missing in .NET, e.g.
there is no BigInteger Counter part I found in .NET ( I need it when
developing RSA algo for 100 digits Prime numbers, for example )

By the way I also found the IDE Space in Java is much more advance
then compare to Visual Studio.NET (even VStudio 2005), JBuilder X/2005
and Eclipse 3.0 are far more feature rich then Widbly in their current
Hoping things are changing rapidly in .NET Front as well.

- Khurram Shakir
Microsot Most Valued Professioanl (MVP - Visual C#)

No comments: