The
reason I like console applications so much is that they reduce software
to its bare essentials. Console applications only need to worry about
four things: command-line arguments and the three standard data streams.
The simplicity of this model looks like a severe limitation, but the
pipe allows independent programs to behave symbiotically, enabling them
to do more together than the sum of what they could do separately.
Implementing
console applications with the .NET Framework is easy. With judicious
use of some design patterns, it becomes easier still. The Process class
makes accessing console applications from .NET straightforward, as long
as you understand the limitations. Windows doesn't understand pipes;
cmd.exe does. As such, to get pipe functionality in a Framework-based
program, you need to either route all commands through cmd.exe or build
your own piping capability. Both ways work, but each has trade-offs.
Console
applications are currently an overlooked class of applications on
Windows. This, however, is planned to change in the Longhorn timeframe.
Microsoft is completely redesigning the console as a managed application
for the next major release of its operating system. For more
information on the Longhorn Command Shell (MSH), see the presentation
from this year's PDC session ARC334, available at PDC 2003 Sessions.
No comments:
Post a Comment