This is Dart’s internal name for a product re-design that was started in 2009 and will be completed in 2010. The goals of this project are as follows:
- Re-design each .NET product to expose the power of multi-threading in ways that are simple, elegant and powerful.
- Target the Compact Framework as a supported environment.
- Integrate SSL security as a core feature.
- Add Mono support.
As of this posting, “PowerTCP Telnet for .NET”, “PowerTCP Emulation for .NET” and “PowerSNMP for .NET” are released and the CF versions are being tested.
Background
Communications is essentially a “background” task that should not interfere with the user interface experience.
Under 16-bit Windows (yes, we have been around awhile!) this was accomplished using custom messages that allowed us to interleave communications with UI processing. With 32-bit Windows and the introduction of worker threads the job was made easier by executing synchronous code on a worker thread and informing a method on the UI thread when the job was done. Even so, it was up to Dart to decide what functionality should execute on a worker thread, which could limit our customer’s design.
With .NET 2.0, however, we are seeing more customers working directly on worker threads (ASP.NET, services, or scripting environments), and Microsoft even added a new BackgroundWorker component to help users manage background tasks more conveniently.
New Design
Consequently, Dart’s new design assumes our customer will be invoking methods while executing on a worker thread and provides support for marshaling data or state information back to the UI thread for display purposes. A simple “Start” method is provided that executes a method on a worker thread. Our implementation and sample applications have proven the validity of this new design pattern:
- Reduced design complexity: asynchronous versions of methods and corresponding completion events are no longer necessary and have been removed.
- Improved user design flexibility: user decides what synchronous methods are to be “batched” for synchronous execution on a worker thread.
- Improved efficiency: user decides what data or state information is to be marshaled to the UI thread (if any).
The following code snippit illustrates the new design:
private void Form1_Load(object sender, EventArgs e)
{
// start the Worker method on a worker thread
telnet1.Start(Worker, null);
}
void Worker(Telnet telnet, object notUsed)
{
// this executes on a worker thread, protecting the UI thread
telnet.Connect("myServer");
telnet.Login("username", "password", "$");
telnet.Write(Encoding.Default.GetBytes("ls -l\r\n"));
// marshal the listing back to the UI thread
telnet.Marshal(telnet.Read(new buffer[10000]));
telnet.Close();
}
private void telnet1_Data(object sender, DataEventArgs e)
{
// now on the UI thread, we can put the listing into the textBox
textBox1.Text = e.Data.ToString();
}
Positive customer feedback has confirmed the validity of this new approach for our product designs, and we are working diligently on our new products designs for 2010.



