[Mono-devel-list] TARGET_JVM Patch for MSXslScriptManager.cs

Miguel de Icaza miguel at ximian.com
Sat Apr 2 14:34:03 EST 2005


Hello,

> I'm starting to send patches for Mainsoft Visual MainWin for J2EE 
> product conditional compilation code. These patches will not affect 
> compilation results as long as one does not define TARGET_JVM.

My personal preference for this kind of routines, where a whole routine
is completely reworked is to split this at the function level, so we can
do:

#if TARGET_JVM
	public object Compiler (XPathNavigator node)
	{
		throw new NotImplementedException ();
	}

	public void AnotherRoutine ()
	{
	}
#else
	public object Compiler (XPathNavigator node)
	{
		...
	}
#endif

This has the advantage that when C# 2.0 becomes a requirement, we can
just split the code like this:

	File.cs
	File-jvm.cs
	File-clr.cs

And use partial classes so the ifdefs in the source code can be
completely removed.

For this instance, its ok, but lets keep this in mind.

Miguel



More information about the Mono-devel-list mailing list