Developer .NET UPDATE, June 11, 2002

Developer .NET UPDATE—brought to you by the Windows & .NET Magazine Network
http://www.winnetmag.com


THIS ISSUE SPONSORED BY

Microsoft ASP.NET Connections
http://www.asp-connections.com

XML Web Services Connections
http://xmlconnections.com
(below DEVELOPER .NET PERSPECTIVES)


SPONSOR: MICROSOFT ASP.NET CONNECTIONS

MICROSOFT ASP.NET CONNECTIONS TO CO-LOCATE WITH SQL SERVER MAGAZINE LIVE!
Microsoft ASP.NET Connections, along with VS.NET Connections will co-locate with SQL Server Magazine LIVE! in Orlando, FL, at the Hyatt Grand Cypress Resort on Oct. 27 - 30. Keep your career on track. Learn from top third-party gurus, Microsoft product developers, and magazine authors. This is a must attend event to keep your skills sharp and to dig deeper into the .NET Framework and what it means for you and your company. It's chock full of practical information you can use right away. Real content with real value for you. Register for one conference and attend the other two conferences for FREE. Go to
http://www.asp-connections.com


June 11, 2002—In this issue:

1. DEVELOPER .NET PERSPECTIVES

  • Weaving the Threads of Your Application

2. ANNOUNCEMENTS

  • Win a Free $200 Gift Certificate to RoadWired.com!
  • Struggling with IIS and Web Administration Concerns?

3. NEW AND IMPROVED

  • Build, Manage, Integrate, and Change Enterprise Applications

4. CONTACT US

  • See this section for a list of ways to contact us.

1. DEVELOPER .NET PERSPECTIVES
(contributed by Bill Sheldon, [email protected])

  • WEAVING THE THREADS OF YOUR APPLICATION

  • For most application developers, the core difference between Microsoft .NET applications and Visual Basic (VB) applications lies in their multitasking support. Unlike VB applications, .NET applications are oriented toward shared data and collaborative work environments. With .NET applications, developers can perform more than one task at a time—something that traditional VB applications don't support. If a VB 6.0 application starts processing a large data file, it stops everything else. The most developers can do is call the DoEvents function so that the OS can come up for air. The DoEvents function is the closest VB has come to multitasking; the function stops an application’s processing to see whether the OS sent any event messages to process.

    Languages such as Visual C++ (VC++) have always supported multithreading (i.e., the technology that makes multitasking possible), but historically they typically haven't been application developers’ first choice. With VC++, you can create some killer applications—applications that you just can't create with a single-threaded language such as VB.

    Microsoft has added multithreading, native calls to system APIs, and other enterprise features to the Common Language Runtime (CLR) to make the .NET languages first class. CLR lets .NET applications not only spawn multiple threads but also natively support multithreaded operations. Having components that can be safely and simultaneously called by multiple threads is what makes components that run under multithreaded hosts (e.g., Microsoft IIS) highly scalable.

    A worker thread in an application lets users work with an application while a computation, file transfer, or another extended activity occurs in the background. Spawning worker threads requires developers to write code that takes advantage of multiple threads. Let's look at how you can add multiple threads to an application.

    Creating a second thread in .NET languages is deceptively simple. You just need to create a System.Threading.Thread object. To begin, you must first create a System.Threading.ThreadStart delegate. The ThreadStart delegate takes the address of a method. The method might be part of the current class or associated with an instance of an alternative class. The delegate class lets the OS pass the address of a specified object method to a new thread, which, in turn, can call that method. The result is an instance of the ThreadStart object, which is passed to the Thread class constructor. You can then add data and properties to the Thread class instance, which will run as a worker thread when you call the thread's Start method. For more information about the ThreadStart delegate and Thread object, see the Microsoft Developer Network (MSDN) Library.

    After you assign the starting class and add data and properties, the thread doesn't automatically begin processing. To start the new thread, you need to call the Start method; to stop the thread, you call the Stop method. If you look at all the members of the Thread class, you'll see that the class supports the ability to not only start and stop a thread but also query a thread to determine whether it's still running, pause a thread if too many system resources are in use, and perform a variety of other thread-management functions.

    However, these Thread class methods are the tip of the multithreaded-programming iceberg. The simplicity of using these methods gives way to less visible, larger problems associated with coordinating multiple threads in a multithreaded application. The complexity of using a language such as VC++ to develop applications is partly due to the language's syntax, the large set of multithreading classes with which to work, and the challenges associated with managing threads. Although the .NET Framework's languages simplify access to multithreading classes, constructing threads that behave correctly requires additional consideration in the design stage.

    With that thought, let's discuss the use of new .NET tools, such as Visual Studio .NET. The general consensus is that these tools will make development faster, better, and cheaper. Although you can, no doubt, create better applications, keep in mind two caveats to the "faster, better, and cheaper" mantra. First, faster, better, and cheaper" depends on where you start. Second, "better" often comes at the expense of "faster" and "cheaper." Thus, although the .NET tools support a better development environment for enterprise applications, those applications might require a greater design commitment from developers. The application that a C++ developer can already build better might now get built faster and cheaper with Visual C# .NET. However, faster and cheaper might not be feasible for an experienced developer who, for the first time, is creating a true multithreaded application.


    SPONSOR: XML WEB SERVICES CONNECTIONS

    XML WEB SERVICES CONNECTIONS TO CO-LOCATE WITH WINDOWS & .NET MAGAZINE LIVE!
    XML Web Services Connections and Windows & .NET Magazine LIVE! will co-locate from Oct. 30 - Nov. 2 immediately following Microsoft ASP.NET Connections, VS.NET Connections, and SQL Server Magazine LIVE! Deep discounts will be available for those attending the entire week of conferences. Save even more by registering now to lock in your Early Bird discount. For more information, go to
    http://xmlconnections.com


    2. ANNOUNCEMENTS
    (brought to you by Windows & .NET Magazine and its partners)

  • WIN A FREE $200 GIFT CERTIFICATE TO ROADWIRED.COM!

  • Visit the Connected Home Virtual Tour and browse through the latest home entertainment, home networking, and home automation options. Sign up for prize drawings, too, and you might win a free gift certificate to RoadWired.com. Take the tour today!
    http://www.connectedhomemag.com/virtualtour

  • STRUGGLING WITH IIS AND WEB ADMINISTRATION CONCERNS?

  • Discover Windows Web Solutions online, the Web site with articles, tips, and more to help you manage and overcome the security, performance, and maintenance concerns Web site administrators deal with every day. Don't miss this article: "15 Tips for Troubleshooting VPN Connections" ( http://www.windowswebsolutions.com/articles/index.cfm?articleid=8290 ). Check it out!
    http://www.windowswebsolutions.com

    3. NEW AND IMPROVED
    (contributed by Carolyn Mader, [email protected])

  • BUILD, MANAGE, INTEGRATE, AND CHANGE ENTERPRISE APPLICATIONS

  • WebPutty released the WebPutty Flexibility Platform 5.0, software that helps you build, manage, integrate, and change enterprise applications. The platform has three main modules: Flexibility Server, Development Suite, and Interoperability Suite. Flexibility Server is a server that runs applications and Web services. The server provides support for rich XML Web services. Development Suite contains Developers Studio and Business Studio, which let you quickly make changes to running applications and orchestrate the interaction between WebPutty and external applications. Interoperability Suite contains the Discovery feature, which lets WebPutty understand the structure and definition of external applications, objects, data sources, and services. For pricing, contact WebPutty at 408-282-4000 or 888-841-4932.
    http://www.webputty.com

    4. CONTACT US
    Here's how to reach us with your comments and questions:

    (please mention the newsletter name in the subject line)

    This weekly email newsletter is brought to you by Windows & .NET Magazine, the leading publication for Windows professionals who want to learn more and perform better. Subscribe today.
    http://www.winnetmag.com/sub.cfm?code=wswi201x1z

    Receive the latest information about the Windows and .NET topics of your choice. Subscribe to our other FREE email newsletters.
    http://www.winnetmag.net/email

    Hide comments

    Comments

    • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

    Plain text

    • No HTML tags allowed.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Lines and paragraphs break automatically.
    Publish