23
Tue, Apr
1 New Articles

Get the Most out of .Net 3.0, Microsoft's Latest Developer's Tools

Development Tools
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Microsoft's latest .Net features are examined in an interview with Dan Waterbly, an accomplished .Net developer with the Washington State Digital Archives.

 

Dan Waterbly is a .Net applications developer for the Washington State Digital Archives, the first state agency built specifically for storing and accessing digital public records. The Digital Archive is a "100% Microsoft" shop where the most current .Net features are explored in a data-centric production environment. In this interview, I ask Dan about the nature of the latest development tools from Microsoft and his experiences using them in practice.

 

MC Press: Dan, as an overview, does .Net 3.0 replace .Net 2.0, or do you have to have 2.0?

 

Dan: You have to have 2.0. .Net 3.0 uses the same architecture and is really just a bunch of classes added on to 2.0. It doesn't replace anything; 3.0 runs on the 2.0 architecture.

 

MC Press: The features included in .Net 3.0 seem to be some of the same elements that didn't make it into Vista when it was released. There are four listed features in .Net 3.0 documentation: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Windows Cardspace. So to begin, what can you tell me about Windows Presentation Foundation?

 

Dan: Vista's look--you know, the whole UI change and the new aero look--is much more attractive, with the glossy look and glass background, and [Microsoft] has made it so you can develop much more graphic-intense applications compared with WinForms, which are pretty basic. Not that Microsoft is going to get rid of WinForms anytime soon, but WPF is another option you can go with.

 

MC Press: Well, what's the difference between a WPF application and a WinForms application?

 

Dan: The UI controls are different and more flexible, and WPF is XAML-driven. WPF uses a markup language to dictate how your user interface is going to look. WinForms is the classic Windows look, like an application you create in pre-2008 Visual Studio versions. With WPF, using XAML, you can create Windows applications like you would Web pages, with markup language, and basically code against that. It's kind of like ASP.Net, where you have a better separation between the application logic and the presentation logic.

 

[Microsoft's] Silverlight comes out of the WPF. Silverlight is a plug-in like Flash that gives you a subset of WPF on a Web browser. So you can develop some rich-client stuff for the user.

 

MC Press: What is WCF, or Windows Communication Foundation?

 

Dan: Whenever you talk about WCF, you're dealing with some service-oriented architecture where you're providing some kind of service that will be consumed by one or more clients. The consumers can be anything. They can be Java-based applications, or they can be .Net applications or Python applications. Anything that can consume a Web service can connect to a WCF service, assuming that the WCF service has the appropriate endpoints configured. The problem with previous versions of .Net is you could have a variety of transport mechanisms that could communicate with a variety of consumers. The problem with all that is you would end up having many different sets of code that all do the same thing. WCF combines all that so you write the code once and specify how [the clients] will consume the service, and that's all done through an endpoint.

 

MC Press: What's an endpoint?

 

Dan: A WCF service uses a configuration file to dictate the endpoints to use. An endpoint consists of an address, binding, and contract (ABC). The contract dictates what methods in the WCF service may be called by the consumer. The binding defines the transport mechanism, and the address dictates where the service can be accessed from.

 

MC Press: So the contract part of the endpoint is similar to the public methods available from a Web service?

 

Dan: Yes. You know how on a Web service you mark [a function] with a WebMethod attribute? With a WCF service, you create an interface and you mark it with an OperationContract attribute. Then you create a class that implements that interface; this is where all your business logic is, and every method you specified as an OperationContract will be accessible to the clients that are consuming your service.

 

Also with WCF, you don't have to run your application on IIS like you did with a Web service. You can run it in a Windows service and specify how the endpoints work, and it will create your server for you and communicate that way. It's called the "service host environment." You can run it in a Windows form application or as a Windows service, anywhere a .Net executable can run so you don't get all that IIS overhead.

 

MC Press: Let's talk about Windows Workflow Foundation. Did I notice it's abbreviated as "WF" rather than "WWF"?

 

Dan: Yes. As I heard it--and this may be just a rumor--Microsoft wanted to use the abbreviation "WWF," so they went to the World Wrestling Foundation and said, "Hey, can we use it?" and they said, "Sure, we don't care." So they did. And apparently the next day they received a cease and desist order from the World Wildlife Fund, and that's how they named Windows Workflow Foundations as "WF." The World Wrestling Foundation failed to tell them they fell into the same problem when they changed from being WWF to WWE.

 

What Workflows does is it allows you to create a flowchart or a process diagram describing what you want your application to do. I know from my work experience it's been a nice tool from a boss' perspective, where they don't understand code but they can look at the diagram and understand what it's doing.

 

Basically, Workflow consists of multiple "activities" that are tied together. Through variables, what [Microsoft] calls "dependency properties."

 

MC Press: It sounds like a transaction as we know it on a platform like the iSeries.

 

Dan: Well, yeah, you can do things transactionally, and you can also do things in a compensatable way. Out of the box, Workflows give you a number of different activities. One of the activities is the transactional scope activity. You can include a transactional scope activity in your workflow diagram, and within that activity, you can link together other activities. If one of the activities in the scope fails, the whole transaction is rolled back. It's a total atomic process, and it takes very little code from the developer.

 

WF doesn't, however, reverse everything. For example, if you have an activity that does an FTP transfer and another activity that makes database calls, and one of the activities fails, [WF] will roll back the database calls, but it won't roll back the file that was uploaded.

 

There are ways where you can write your own instructions to reverse activities any way you want. There's a lot of flexibility in there, but I think it gets complicated when you want to start doing that stuff.

 

MC Press: What have you observed when using WF in a production environment?

 

Dan: One problem I've run into is  running a transaction  against multiple data sources. So let's say you have two databases that you're working with, where one might have metadata and one might have binary objects, and you have a lot of transactions that run simultaneously. You either run into deadlocks or you run into issues with the Microsoft Distributed Transaction Coordinator. We ran into that firsthand. And we tried to deal with it in a couple of different ways.

 

In the transaction scope, you can set isolation levels, and basically an isolation level dictates what data is accessible to other processes at the same time that this transaction is running. So you can set it to serializable, meaning it runs on its own, and whatever it's working on, nothing else has access to. That's going to put the most locks on the database. But you can use a lower isolation level, and that will produce fewer locks, and it will also allow dirty reads, so if something in that transaction fails, you could get a rollback, and a user may be looking at phantom data, data that was there but got rolled back later.

 

We had 40 servers, each running eight instances of WF, so that's 320 workflows running at once, and all of them have their own transaction scopes, and it killed our production speed. We got many errors regarding the Distributed Transaction Coordinator and database deadlocks. So instead of using the transaction scope, we used compensatable activities, where you write your own rollback code for your custom activities. You lose the transaction scope, but you gain the benefit of undoing what the activities did.

 

MC Press: What can you tell me about the fourth feature of .Net 3.0, Windows Cardspace?

 

Dan: Cardspace is a digital identity in the form of a cyber card for use on the Internet that could be used to take the place of passwords or other authentication mechanisms. I question how useful it is, though, because of problems with it on Linux and Mac platforms and a lack of support on early versions of Windows.

 

MC Press: Well, how does Cardspace work?

 

Dan: It's like when you go to the store and buy something with your credit card and you're asked to show your photo ID to confirm your identity. What happens is, you go to a Cardspace Web site; your Windows machine will pop up and say either create a card or use an existing card. So if you already have a card for the site, you just pick your card, and they say, "OK, we know who you are now because you've given us a token identifying yourself." You don't have to log in. You don't have to do anything.

 

MC Press: What if someone else is using your machine?

 

Dan: Right, yeah. It's one of those [physical security] things. But Cardspace is linked to your Windows user account, so if you log in under your account and no one else can use your account, then you're OK.

 

MC Press: .Net 3.5 is available now. What's in there?

 

Dan: LINQ (Language Integrated Query) and there's some ADO.Net stuff that works with LINQ. You can use LINQ to query a SQL server. What I find most impressive with LINQ is you can write SQL-like queries against XML or any collection of objects that are enumerable in the .Net Framework.

 

Also AJAX (Asynchronous Java and XML) is now embedded in .Net 3.5, and you don't have to download it separately. AJAX allows you to do partial Web page updates and gets rid of the flicker when you go to pages. I have heard that AJAX is actually slower but the way the page responds to the user makes it seem faster. I personally think it is faster.

 

MC Press: Are all these features--.Net 3.0 and 3.5--included with Visual Studio 2008?

 

Dan: Visual Studio 2008 provides the 3.0 and 3.5 framework right out of the box. With 2005, you need the extensions. So if you have 2005 and the extensions, that should work, too.

 

MC Press: In your opinion, what's the best part of .Net 3.0?

 

Dan: Windows Workflow. If you have a complex transaction, [WF] breaks it up in such a way that it's easy to understand. It's so much easier to look at a diagram to see what's happening than it is to trace your code. The activities are so modularized and can be used in multiple applications. It's flexible, easy to understand, easy to learn, and easy to use.

 

MC Press: With all that said, Dan, what do you not like or are disappointed with in .Net 3.0?

 

Dan: The biggest thing I haven't liked about .Net is the way the database interactions go. It seems like it takes a lot [of effort] to insert a SQL parameter, and set your parameters up, and execute a stored procedure. You know, it's just a lot of code to do it. You can use the Enterprise Library to make it quicker and easier, but it would be nice if they would just build that into the Framework so you don't have to download another library, register it in the GAC, and suffer through potential deployment issues.

 

I was also hoping [Microsoft] would improve "click-once" so that it didn't require that you use a certificate that expires in a certain amount of time. The idea behind click-once is that updates can be deployed really easily, but when your certificate expires, that defeats the process.

 

MC Press: Thank you, Dan.

Chris Peters has 32 years of experience with IBM midrange and PC platforms. Chris is president of Evergreen Interactive Systems, a software development firm and creators of the iSeries Report Downloader. Chris is the author of i5/OS and Microsoft Office Integration Handbook, AS/400 TCP/IP Handbook, AS/400 Client/Server Programming with Visual Basic, and Peer Networking on the AS/400. He is also a nationally recognized seminar instructor and a lecturer in the Computer Science department at Eastern Washington University. Chris can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..


MC Press books written by Chris Peters available now on the MC Press Bookstore.

i5/OS and Microsoft Office Integration Handbook i5/OS and Microsoft Office Integration Handbook
Harness the power of Office while exploiting the i5/iSeries database.
List Price $79.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: