Analyze Your Code
by Leonard Lobel

Quick Facts
Total .NET Analyzer
FMS
Web: www.fmsinc.com/
dotnet/analyzer
Phone: 866-367-7801;
703-356-4700
Price: $499
Quick Facts: A code-analysis tool for improving the performance of VB.NET and C# applications.
Pros: Easy to use; detects many potential issues.
Cons: Can't add custom rules.

Enterprise Application Lifecycle Management 2003

Total .NET Analyzer is a code-analysis tool that helps you build better .NET apps. It integrates with VS.NET as an add-in and functions like any tool window you can dock, undock, or collapse.

You load a VS.NET solution and click on Analyze in the toolbar to conduct an instantaneous analysis of your code. Total .NET Analyzer parses your solution source files and detects potential issues, which appear immediately in a list below the toolbar. Each issue's description includes severity, category, name, project, file, namespace, class, method, line number, and even character position, as well as a preview of the offending source line. You can use intuitive drag-and-drop to organize the issues list by any grouping level. Another toolbar button creates a formatted, printable report of detected issues in a preview window.

Clicking on any item navigates to the relevant source-code line so you can assess and resolve the issue quickly. You can click on the Information button to display an integrated HTML help page that describes the issue and provides the appropriate resolution (see Figure 1).

Total .NET Analyzer detects more than 150 issues and assigns them to Error, Performance, Standard, Suggestion, Unused, and VB Legacy categories. My favorite category is "Unused," which reveals unused assignments and variables—dead code that invariably winds up lying around once development is complete. The Rule Editor lets you exclude a rule from analysis, change a rule's category or severity, and add notes to a rule that appear when the issue comes up. However, you can't add your own rules.

It's up to you to make the final determination on reported issues. For example, DirectCase is always faster than CType, but only you can decide that it is safe to use DirectCase when you know that the runtype type will always be the same as the specified conversion type. Your own conventions will render some issues as not pertinent in many cases. For example, if you name your controls in "camelCase," you'll receive "PascalCase" issues for every control in your app, because FMS follows Microsoft-suggested naming conventions. You can use the Rule Editor to exclude such issues from being reported. (The product reports many issues—including PascalCase—on code VS.NET generates automatically for strongly typed datasets.)

The documentation is clear and thorough, and technical support is courteous and responsive. The tool had difficulty parsing one of my projects, and a friendly representative handled my call. Within a few days, FMS released a new version that fixed the problem.

If you've ever wished you could have a clone of yourself watching over your shoulder, ensuring that you adhere to best practices, Total .NET Analyzer is for you.

About the Author
Leonard Lobel is the CEO and founder of Sleek Technologies Inc., a development shop specializing in Microsoft-based solutions. He's also the director of software for Government Data Publications in New York, and a consultant and trainer with more than 24 years of experience. Reach him at .



Generate Data-Access Code Quickly
by David Mack

Quick Facts
ORM.NET
Olero Software
Web: www.olero.com
Phone: 303-385-4908
Price: $495
Quick Facts: Object-relational mapping and code-generation tool that generates C# data-access code automatically from your SQL Server database schemas and stored procedures. Lets you set scope of accessor and mutator functions for each member of your schema.
Pros: Saves substantial coding time; no requirement to know SQL or how to write stored procedures.
Cons: Supports only SQL Server and C#; dependence on third-party package to access data.

Enterprise Application Lifecycle Management 2003

ORM.NET lets you generate object-oriented C# code that interfaces with SQL Server databases in much less time than it would take you to write the code by hand. It takes an existing database and stored procedures, then creates wrappers for them automatically. This saves you a tremendous amount of work vs. hand-typing the wrapper classes to access ADO.NET.

The product generates C# data-access classes, wrapper classes for stored procedures, and strongly typed code that improves IntelliSense. You'll benefit from ORM.NET the most if you have an existing database and large amounts of data-access code to write. Comparable tools require you to define your own classes and database relationships. Defining your own classes enables bugs to enter your program through typos and cut-and-paste errors. ORM.NET relieves you of these burdens. It generates classes and defines database relationships through the UI, setting relationships as "one to many" by default. It handles issues such as spaces in the database name that aren't valid in the C# variable names. ORM.NET also allows you to set the scope of your accessor or mutator functions. The UI lets you see each property's data type and whether it's declared as a key, as well as other metadata (see Figure 1). If you're reluctant to use ORM.NET on an existing database, you can use the database that comes with the product, which requires a separate installation step.

ORM.NET doesn't support VB.NET. However, you can write your business/presentation layer in VB.NET through the magic of the .NET Framework, then let ORM.NET handle the rest for you. The product doesn't support any databases other than SQL Server, and you must include an ORM.NET library in your project. Also, you'll experience a small performance hit if you use the data-access code instead of stored-procedure wrappers. Neither the built-in help nor the Web site mentions connection pooling. It would be nice to know exactly how the product handles it and what you must to do to take advantage of this feature in ADO.

Otherwise, the Olero Web site is informative and describes ORM.NET's functionality clearly. It presents a comparison between using straight ADO.NET vs. ORM.NET that's especially helpful. You can also view sample-generated code on the site.

Overall, ORM.NET's UI is intuitive and simple, as is the code that the software generates. You might view the reliance on third-party software as a maintenance issue, but the time you save writing code can easily justify its use. You'll be able to see the benefits of ORM.NET within minutes of running it the first time.

About the Author
David Mack is a technical lead for the National Intelligence Division of Titan Systems, as well as an adjunct professor at Northern Virginia Community College. He has more than 10 years of experience in object-oriented programming. Reach him at .



Give WinForms a New Outlook
by Ken Cox

Quick Facts
Janus Systems Controls Suite
Janus Systems
Web: www.janusys.com
Price: $549
Quick Facts: Windows Forms controls package including an advanced grid control, an Outlook-style button bar, a toolbar, and a scheduler.
Pros: Polished, professional-looking controls; excellent design-time integration with VS.NET; royalty-free redistributables.
Cons: Help missing on GridEX properties; somewhat advanced for beginners; keyboard use of GridEX inconvenient.

Enterprise Application Lifecycle Management 2003

The Janus Systems Controls Suite is a collection of versatile and attractive Windows Forms controls for .NET development. The control suite includes GridEX, Schedule, ButtonBar, ExplorerBar, CalendarCombo, and Timeline controls, and lets you create applications that closely resemble Microsoft Outlook in appearance and functionality. Janus Systems licenses the components per developer machine, but charges no runtime fees for redistributable files (see Figure 1).

You can install the suite's controls easily, but you must remember to add them to the VS.NET toolbox manually. It is worth your while to examine the sample code and useful tutorials before trying to design your own forms with these sophisticated controls. For example, the advanced project does a good job of demonstrating how to use these controls. However, it would be even easier to use them if the source code were commented.

The centerpiece of the suite is the powerful and flexible GridEx control, which lets you display and edit data in a hierarchical structure. You can create groups, sort data in a jiffy, and add stunning backgrounds complete with gradient effects. It would be nice if the tool also included a single command to expand and collapse the contents of all groups. The keystroke navigation needs some work, especially when scrolling to the right.

GridEX's designer includes an almost overwhelming number of properties, formats, groups, and preformatted styles. Fortunately, the default settings are usually acceptable, so you won't get bogged down. Note that the designer lacks on-screen descriptions of the properties in their designated area.

Overall, this package lets you re-create the look and feel of Microsoft Outlook nicely: The ExplorerBar control provides the left-side navigation, and the Schedule control is a dead ringer for Outlook's calendar UI. But the suite goes a step beyond re-creating Outlook's features. For example, the Timeline control supplies functions you'd find in Microsoft Project, and the controls themselves can be set to mimic the styles used in Office 2000, Outlook Express, Office XP, or the Visual Studio toolbox. Janus gives you a dozen additional ways to customize the hover effects over an Explorer bar button if the existing templates don't suit your needs.

Integration with Visual Studio .NET is so thorough that you might think the Janus controls shipped with VS.NET as enhanced controls. Janus makes good use of the functional links in the Properties window and the help hyperlinks in the Dynamic Help window.

The Janus Systems Controls Suite is a polished and professional package, but not for beginners. These controls take time to learn, but will save you hours of effort and add functionality and visual appeal to your Windows Forms applications.

About the Author
Ken Cox is a VB.NET developer in Toronto building e-commerce Web applications and XML Web services. Ken is a former broadcast journalist and a Microsoft MVP for ASP.NET. Reach him at .



Track Bugs and Feature Requests
by Ken Cox

Quick Facts
DevTrack 5.1
TechExcel
Web: www.techexcel.com
Phone: 800-439-7782;
925-871-3900
Price: $495 per user
Quick Facts: Bug- and project-tracking package for software-development teams.
Pros: Intuitive, easy-to-learn interface; excellent sample project; highly customizable.
Cons: Lacks context-sensitive help; pricey for small software developers.

Enterprise Application Lifecycle Management 2003

DevTrack 5.1 is an advanced bug- and project-tracking package for software-development teams. In addition to offering traditional Windows GUI client applications, DevTrack uses Internet Information Services (IIS) to support browser-based data entry and reporting. The back end uses Access, SQL Server, Oracle, Sybase, or Borland's InterBase database.

Tracking defects and feature requests takes a great deal of organizational effort, especially when team members are scattered in multiple locations. DevTrack aims to streamline the workflow and make projects manageable. A bug report is usually more than a simple text description. It might include a log file, a screenshot, a Knowledge Base article, and a customer contact. DevTrack coordinates these elements by letting you upload files and documents along with the issue, include links to fixes and workarounds, and associate the bug with files checked in to Visual SourceSafe. DevTrack also includes an NT service for automating e-mail notifications to team members. The Enterprise version offers an Internet portal where customers and partners can participate in defect tracking.

Installation of DevTrack is easy but assumes a working knowledge of databases and IIS. For example, manual intervention was necessary when the Web configuration tool failed to set the access rights correctly on the Scripts directory in IIS 6. Be sure to install and explore DevTrack's sample bug-tracking project and its accompanying tutorial. These excellent resources demonstrate the software's procedures and concepts quite clearly.

Every issue in DevTrack has a unique ID and an owner (a team member or a group) throughout its lifecycle. This ensures that problems are tracked rather than sidetracked. DevTrack supports user roles to keep members focused on their tasks: Managers can view reports on showstoppers, team leaders can distribute bugs to programmers, and developers can update their progress and forward fixes to the QA team for closing.

The GUI and Web client interfaces are intuitive and uncluttered. It's easy to enter everything you need to report about a problem, such as the description, software version, and priority. The History tab is a great way to get a quick summary of what's been happening with a bug (see Figure 1). The administration interface lets you customize almost everything about the product—including the graphical interface, mandatory fields, spell-checking, permissions, and e-mail lists—but it's fairly complicated. TechExcel should implement context-sensitive help and tooltips to assist the user.

Although it's somewhat expensive for smaller companies, DevTrack 5.1 is packed with features and options that should bring order to chaos in a software-development operation of any size.

About the Author
Ken Cox is a VB.NET developer in Toronto building e-commerce Web applications and XML Web services. Ken is a former broadcast journalist and a Microsoft MVP for ASP.NET. Reach him at .



Accelerate Your Development
by Andy Clark

Quick Facts
CodeObject 3.0 for VB.NET and C#
Madinina Software
Web: www.codeobject.com
Price: $299
Quick Facts: Provides time-saving development tools for .NET.
Pros: Great set of extensions for the VS.NET environment; can reduce coding time significantly.
Cons: Difficult to understand some of the enhancements without using them; might conflict with some other add-ins.

Enterprise Application Lifecycle Management 2003

CodeObject 3.0 for VB.NET and C# provides a variety of tools that can make you a more productive .NET programmer. It augments VS.NET to reduce the time you spend writing code, and it removes some of the drudgery from coding.

CodeObject expands IntelliSense with a feature called IntelliCode. IntelliSense lets you complete already declared variable and object names automatically. IntelliCode provides the same capability for language keywords, statements, and identifiers (see Figure 1). Type "f," and IntelliCode shows the syntax of the finally, for, and foreach statements. Better, CodeObject places a template in your code when you choose the statement type you want. IntelliCode also speeds entry of repetitive expressions by letting you include previous entries automatically. Say you're trying to check for aBigTestExpression equal to b or c or d. Once you type "if (aBigTestExpression=b |", IntelliCode lets you fill in "aBigTestExpression=b" again automatically.

Another nice feature is auto-imports. CodeObject lets you see all .NET Framework members when you're doing assignments or declarations. When you use a new .NET Framework type, auto-imports adds an import statement for its namespace automatically to the top of your class. The combination of IntelliCode and auto-imports should reduce your compilation errors.

A particularly attractive CodeObject feature is CO-Snippets, which lets you drag pieces of code to the VS.NET toolbox. Then, you can move them to other places in your solution. This is a great way to fill in repetitive code that doesn't quite warrant adding a new method.

CodeObject comes with CodeObject View, an enhancement to the VS.NET Class View. CodeObject View presents class methods and properties in the order they appear in the source. It synchronizes with your source code automatically and assists you in identifying inheritance errors.

CodeObject provides numerous other features. Many of them are difficult to understand until you use them, but they all focus on reducing the time you spend writing code and correcting compilation errors.

Madinina Software provides good documentation, complete with examples, that's built into VS.NET's help system. I found Madinina's technical support helpful and professional.

I did encounter some difficulty using CodeObject. The product experienced a conflict with one of the many add-ins on my evaluation machine and wouldn't work until I corrected the conflict. The Madinina support staff was extremely helpful with resolving this difficulty. It's unlikely you'll experience this problem if you're a typical developer.

Overall, the product provides numerous useful extensions to the VS.NET environment—enough variety that you'll probably find a CodeObject enhancement or two that's helpful for you. CodeObject should truly speed your code-development efforts.

About the Author
Andy Clark is a consultant with iGate Inc. in the Richmond, Va., area. He holds PMP, MCSD, and SJCP certifications. Reach him at .



Automate .NET Assembly Unit Testing
by Ken Cox

Quick Facts
.TEST 1.0
Parasoft
Web: www.parasoft.com
Phone: 626-256-3680
Price: $3,495 per single user (machine locked)
Quick Facts: Automates unit testing of classes in .NET assemblies by analyzing coding standards and probing functions.
Pros: Handles the mind-numbing testing that developers don't do well; exercises code thoroughly; creates customizable tests and reports.
Cons: Expensive for individual use; license tied to one computer; somewhat sluggish; avoidable installation glitches.

Enterprise Application Lifecycle Management 2003

.TEST 1.0 is a sophisticated automation tool for unit testing .NET assemblies. Its purpose is to allow you and your manager to root out poorly written code and errors that could cause crashes. This automated error-prevention application takes you directly to the troublesome source code and even suggests a fix before the assembly gets off your hard drive.

You can point .TEST to a .NET assembly (DLL or EXE) and generate two types of reports. The static analysis shows violations of coding rules (drawn from Microsoft's Design Guidelines for Class Library Developers). This feature evokes visions of a Dilbert cartoon where the boss uses .TEST's charts to show the number of times Dilbert used "mysterious acronyms in property names." Fortunately, you can delete annoying rules, such as the one that flags the parameter name "e" in VS.NET-generated code.

The dynamic analysis shows .TEST's real strength. It creates stubs (in C#, not VB.NET) and test cases that exercise your functions with bad data, such as a Null where you expect a string. You can drill down into reports that reveal the code's weaknesses and failures (see Figure 1). For example, you can see the test values, the expected result, and the actual result for each call. You can edit these scenarios and retest for regression errors. A valuable .TEST feature for Web developers would be a dynamic scan to ensure that user input is validated to thwart scripting and overflow attacks.

Parasoft boosts .TEST's performance by prescanning your .NET assemblies, but the tool seems sluggish, especially on startup, perhaps because it uses the Java runtime. The documentation is usable but could go further to teach developers what makes their code accident-prone.

Installation of .TEST wasn't smooth. The VS.NET toolbar add-in failed, because .TEST wanted Visual C++ .NET—and the older 2002 version at that—installed on my machine. Parasoft support incorrectly diagnosed a failure to shut down VS.NET before the installation. (The setup should check for that condition anyway.) The final hurdle was a license key that disabled most product features. After all that, .TEST's VS.NET integration turned out to be somewhat shallow, consisting mainly of launching the standalone GUI and displaying troublesome source code.

However, this valuable tool handles the mind-numbing drudgery of testing and retesting every line of code in every assembly in a project. If you're an independent developer, you might dream of automated bug hunting with .TEST at your workstation before a daily check-in. However, at .TEST's steep price—with the license tied to a single machine ID—a common build machine is a more likely installation location.

About the Author
Ken Cox is a VB.NET developer in Toronto building e-commerce Web applications and XML Web services. Ken is a former broadcast journalist and a Microsoft MVP for ASP.NET. Reach him at .