[Mono-dev] SPAM-LOW: Application Portability Guidelines.
Charlie Poole
charlie at nunit.com
Mon Jul 31 18:21:37 EDT 2006
Hi Miguel,
> I have created a new page on the Wiki to serve as a
> tutorial to help people who want to port their applications
> from Windows to Linux to have a central location to look for
> information, the page is:
>
> http://www.mono-project.com/Guidelines:Application_Portability
>
> Feel free to augment the page with your experiences or
> with tools, tricks and tips that might be useful to others.
I'd augment if I could access, but here are some comments in any case...
1) In general, I'd try to encapsulate _all_ operations that operate on file
paths. Case sensitivity, the PathSeparator, the DirectorySeparatorChar, etc.
are all at issue. More subtle things include what's an absolute path: /bin
is absolute on Linux but needs a drive to make it absolute on Windows.
2) For classes that manipulate paths, it's useful to use dependency
injection for the platform rather than have them detect it. That way, you
can test for each platform under a single platform.
3) For some tests, you can use paths like /a/b/c that work on both
platforms, but watch out: methods like Path.GetAbsolutePath() will do
different things on each platform.
4) Shouldn't there be a section on using GTK# as a cross-platform Gui?
As I continue to migrate the new NUnit release, I'll be glad to chip in with
the tips I find useful. I'm learning as I go, so I'll probably hit every
pitfall.
Charlie
More information about the Mono-devel-list
mailing list