- The Purpose of Coding Standards
- Java and .NET
- Sample Java Coding Standards
Java and .NET
To make it easier to provide standards that will work in both .NET and Java environments, it's useful to know which components/packages in Java map to which .NET components. Where appropriate, naming standards can be similar for components that map to one another. Tables 1 and 2 reproduce lists provided by Microsoft on their web site.
Table 1Java-to-.NET Component Migration
Java Technology |
Upgrade to Visual J# .NET |
Convert to C# |
Java language |
Java language |
C# language |
Applet |
Not converted |
Windows Forms control |
JavaBean |
JavaBean |
C# class (with BeanInfo and ClassInfo not converted) |
ActiveX control |
Not converted |
ActiveX control |
AWT frame |
AWT frame |
Windows Form |
WFC form |
WFC form |
Windows Form |
Compiled library |
Compiled library |
Not converted |
Resource file |
ResX file |
ResX file |
Table 2Migrations for Individual Packages
Package |
Upgrade to Visual J# .NET |
Convert to C# |
com.ms.awt java.awt |
Java.awt |
System.Windows.Forms |
com.ms.com |
com.ms.com |
System.Runtime.InteropServices |
com.ms.dll |
com.ms.dll |
System.Runtime.InteropServices System.ComponentModel |
com.ms.dxmedia |
Not upgraded |
DirectAnimation |
com.ms.fx |
Not upgraded |
System.Windows.Forms |
com.ms.io |
com.ms.vjsharp.io |
System.IO |
com.ms.lang |
com.ms.lang |
System Microsoft.Win32.RegistryKey |
com.ms.object |
com.ms.vjsharp.object |
System |
com.ms.ui |
Not upgraded |
System.Windows.Forms |
com.ms.util |
com.ms.util |
System System.Collections System.Diagnostics |
com.ms.wfc.app |
com.ms.wfc.app |
System.Windows.Forms System.Globalization.CultureInfo Microsoft.Win32 System.Environment.SpecialFolder System.Threading System.DateTime |
com.ms.wfc.core |
com.ms.wfc.core |
System System.ComponentModel System.Windows.Forms.Design System.ComponentModel.Design System.Resources |
com.ms.wfc.data |
com.ms.wfc.data |
ADODB System.Runtime.InteropServices RDS System.Globalization System System.ComponentModel MSDASC System.Resources |
com.ms.wfc.data.adodb |
com.ms.wfc.data.adodb |
ADODB |
com.ms.wfc.data.ui |
com.ms.wfc.data.ui |
System.Windows.Forms System.Data System |
com.ms.wfc.io |
com.ms.wfc.io |
System.IO System.Globalization |
com.ms.wfc.ole32 |
com.ms.wfc.ole32 |
|
com.ms.wfc.ui |
com.ms.wfc.ui |
System.Windows.Forms |
com.ms.wfc.util |
com.ms.wfc.util |
System System.Diagnostics System.Collections System.Runtime.InteropServices System.Resources System.Globalization |
com.ms.wfc.win32 com.ms.win32 |
com.ms.wfc.win32 com.ms.win32 |
Converted to PInvoke calls |
java.io |
java.io |
System.IO |
java.lang |
java.lang |
System System.Threading |
java.lang.reflect |
java.lang.reflect |
System.Reflection System |
java.math |
java.math |
System.Decimal |
java.net |
java.net |
System.NET System System.IO |
java.security |
java.security |
Not converted |
java.sql |
java.sql |
System.Data.OleDb System.DateTime |
java.text |
java.text |
System System.Globalization System.Resources |
java.text.resources |
java.text.resources |
System.Resources |
java.util |
java.util |
System System.Collections System.Globalization System.Resources System.Configuration |