Productivity tips for the Immediate window

Here is a nice little Immediate window trick I just came across. It's not going to change your life but it might make using the immediate window a little easier.

Have you ever wanted to change the last thing you looked at slightly, perhaps you were looking at the number of rows in the order Table.

?OrderData.Orders.count

and now you want to see the number of rows in the OrderDetail Table. Just highlight the command you just entered, and start changing it, a new command is created automatically.

This this nice when you are checking all the items in a collection by just editing the index.

  • ?OrderData.OrderDetails(0).itemarray
  • ?OrderData.OrderDetails(1).itemarray

I know, your thinking you can just hit the up arrow and the last command is yours for the changing. This is just another little trick for duplicating and altering the last command at the same time.

DevCan 2004

I'm co-chairing two tracks of DevCan coming up in Setp/Oct in Vancover/Toronto (exact dates to follow) - see www.devcan.com for more.

I'm doing the architect track and web track. If you have ideas for content you'd like to see, or have a topic you'd like to present in either of those categories, send them to me. You don't have to be canadian, but it helps :)

New Service Packs for 1.0 & 1.1 .NET Frameworks imminent

.NET Framework 1.0 SP3 and 1.1 SP1 are in tech preview at the moment. Had a nagging bug and want to know if it's fixed?

The contents & links to Tech Preview Downloads can be found here:

http://msdn.microsoft.com/netframework/downloads/updates/sptechpreview/default.aspx

 

How to partition your classes between assemblies

Eric Gunnerson has great post with some performance inspired assembly guidelines for fewer larger assemblies. Versioning and Security units of work. Good reasons.

But a non-performance reason for partitiioning into more assemblies is to stop developers from doing things like referencing your data access layer classes from a user interface layer (without going through a business object layer). If you have your classes in 3 assemblies/projects: UI, BUS and DA, where UI references BUS and BUS references DA, then it's hard for a class in UI to call a class in DA - without going out of their way to add a project reference.

Should a project always correspond to an assembly? Well that's the default but you can create intermediate assemblies called netmodules and link them together with the assembly linker (AL.exe). Net Modules are MSIL but without a manifest. You create the new assembly which links the modules together (and adds metadata) with the AL.exe.

The only problem with all of this is that you have to use the command line to compile your projects into .netmodules and link them afterwards. The net result however is that still end up satisfying Eric's performance tips with the requirement for binary partitioned UI, Business, and Data Access layers.

BizTalk 2004: New Training Course for Developers

We now have a course available for BizTalk 2004 in our Toronto office. I get so many of these requests about BTS2K4 these days. Matt Meleski, who is our BTS guru is teaching the first one on July 5th. Matt's been using BTS 2004 right throughout the beta.  BTS has improved dramatically over 2002, it's quite amazing. I hope I have a chance to sit in on part of it.

TechEd 2004 Sesion Slides & Videos Available Online to Public

The site doesn't yet contain everything but things are trickling in.

http://microsoft.sitestream.com/TechEd2004/

White-box Unit Testing - in whidbey

James Newkirk shows how to write a white-box test in Whidbey He shows how to test the value in a private field and invoke a private method. While you can (not so) easily do that today in NUnit, he demonstrates the PrivateObject class that lets you easily invoke private methods and look at private fields.

Could this “PrivateObject“ class be used for evil? Yes it could be used for evil - I imagine - but no more evil than that of reflection.

James has some great holy war type feedback about Should I or Shouldn't I white-box test. Those who say no probably haven't fought with unit testing a singleton class where we have to test it under multiple configurations that *normally* get set during the initial (private) constructor and/or the private methods called by the constructor. So yes, I can see a use. Is this an excuse? I haven't really thought of another technique....but to quote Michaelangelo, “I am still learning...” (via a silly set of fridge magnets I saw at Chapters today). The silly part of course is how one can learn from (and quote) a famous historical figure through something as silly as a fridge magnet.

Intro to Microsoft Solution Framework 4.0 and the Visual Studio Team System

I'm a certified MSF Practitioner. Great - how many of you know what MSF is? MS doesn't do a great job of marketing this “product” which is really a process or dare say methodology for the software development lifecycle. The angle MSF has over RUP is that it's derived from what MS does to build its own software and in the MCS group. Some key differences:

  • MSF talks about team roles much more that RUP does. It also talks about scalability and combining roles. The minimum team size that can use MSF is 3. Key take away: Never combine the testing & developer roles.
  • MSF is traditionally (and surprisingly) somewhat less iterative than RUP. I ignore that fact because iterations work and big design up front doesn't.

So along with the announcement of Visual Studio Team System, and all it's far reaches into the SDLC, it would only make sense that MS revamp MSF to fit in with this new toolset - and indeed MSF 4.0 is a deliverable of VSTS.

One of the new directions is that MSF now talks about competing process models...calling the existing one “Formal“ and the new one, you guessed it - “Agile“. Marco Dorantes' excellent blog has some interesting criticisms related to how those are distinguished.

For MSF 3.1 today, above and beyond all of the documentation to describe how it works, you also have a series of templates you can use in your own project. This would include an array of  “Plans“ related to Architecture, Development, Deployment, Performance, Security as well as various requirement and specification documents. There is also a handy Risk Assessment template which is great for prioritizing the project risks and if anything I recommend following a rigid risk mitigation discipline in your projects.

In MSF 4.0 you'll see other neato concrete things in VSTS like:

  • Work Items
  • Source Check-in Polices.
  • Document Templates (Word & Excel)
  • MS Project Templates
  • Reports
  • Project Portal/SharePoint site template

You can read more about this here.

Smart Client Deep Dive

Myself and Adam Gallant delivered an MSDN Deep Dive last week about developing Smart Client applications. I covered the overview & secure data access sections. The samples and IssueVision (1.0 C# & VB) along with the slides are available over here. Thanks to those who came out.

Update: If you want to take advantage of getting this stuff (and more) on the DevDays CD, you can fill in the form here.

Data Driven Development

So we have Test Driven Development and Model Driven Development or Design by Contract (similar perspective). But in the past, I've been a fan of Data Driven Development. This is a technique I haven't had the pleasure of using recently....because it relies on you building new applications with new databases.

What is this technique you ask? Well for me it is designing the data model first. In the early days of Client/Server, PowerBuilder and ERwin were my tools of choice. New applications. New databases. My design process (and that of many of my associates) was not so much to design a database but to document the data that existed in the organization - and do that in 3rd normal form. ERwin still stands as one of the best modeling tools ever because it actually made the job of coding up a database schema easier and faster than any other alternative. I could also use my model throughout the entire lifecycle since it did an excellent job at full round trip engineering/synchronization.

One of the cool features of PowerBuilder was your ability to annotate your database schema with UI hints. So you could say that a given column in your database should by default be shown as a checkbox, and that checked should be saved as “true“ and unchecked as “false“ - or whatever weird thing your DBA said it had to store. Whenever you designed a screen with that column, bam you'd have it the way you'd expect - as a checkbox. The downside of PowerBuilder's datawindows of course was that the data store/entity/container was quite pretty tied to your database and they made no attempts to hide that fact. But boy, productivity was really high - although I was producing tightly coupled, loosely coupled code :( .NET let's me build better code now, but productivity is still lacking.

At TechEd a couple of weeks ago, I stopped by the DeKlarit booth for a demo of their product by their lead architect Andres Aguiar. I was happy to see a tool that builds upon the Data Driven Development process. Of course, you don't have to start with an empty database, but this tool does an excellent job of making your job easy when starting from scratch. Andres promised to send me an eval so I can play with it some more to see how it works with existing databases but this tool so stay tuned. I could easily see this tool paying for itself in a matter of a couple of weeks.

As for ERwin, I'm still a fan although it really hasn't changed much in the past 10 years. I remember the first copy I had fit on a single floppy. So did the 200 table model I created with it. I was using LBMS System Designer who stored my model in some kind of 10mb black hole and took 10 minutes to generate a schema. When I first installed ERwin, I had it installed and reverse engineered by LBMS model - and forward engineered to from Oracle to SqlServer inside of 10 minutes. I couldn't believe the schema generation took 20 seconds compared to LBMS at 10 minutes.