[Mono-devel-list] Mono.Posix Structuring
Jonathan Pryor
jonpryor at vt.edu
Sun Sep 26 14:16:14 EDT 2004
On Fri, 2004-09-24 at 07:42, Joshua Tauberer wrote:
> I'd strongly suggest we .NET-ify the new wrappers, though. The methods
> should be cased like other class library methods, and instead of
> returning error codes they should throw meaningful exceptions.
I'm inclined to keep most of the functions follow POSIX -- error return
values, etc. We can layer higher-level functionality (exceptions, etc.)
on top of the low level functions, either as API additions in the
"header-file" classes, or as methods of new classes, but the initial
version should merely wrap POSIX.
Why? Fewer "magic" layers makes debugging easier. Is the bug in the C#
wrapper, the libMonoPosixHelper library, or the API call? (Hopefully
not the API call, but you get the drift.) The less each layer does, the
easier debugging the thing can be.
Also, many of methods of Mono.Posix *shouldn't* be used, as there is a
managed equivalent. For example, open(2), close(2), read(2), and
write(2) are mostly duplicated by System.IO.Stream and its subclasses.
We should emphasize the managed functionality whenever possible, as
these are more portable.
- Jon
More information about the Mono-devel-list
mailing list