Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Thursday, December 6, 2007

Visual Studio 2008 Training Kit

Microsoft has released a training kit for Visual Studio 2008. You can get it at

http://blogs.msdn.com/daiken/archive/2007/11/19/visual-studio-2008-training-kit-now-available.aspx

Definitely worth picking up.

Cool Things in .NET 3.5

This does require Visual Studio to upgrade the database. I am using the Visual Studio Professional Trial for now.

So download the sqlce database from http://www.andargor.com/. Unpack the zip file to the C:\SQLMETAL directory. Now upgrade it according to Microsoft's Instructions at Upgrading CE from Earlier versions.

Next open a Visual Studio Command prompt and change to the directory where you have the compact database from above.

type in the following command

sqlmetal /code:srdce.cs /namespace:d20 /pluralize /serialization:unidirectional /language:csharp srdce.sdf

Open the file srdce.cs in Visual Studio. You now have a class library representation of the database and tables in the srdce.sdf database (in my case it is 6600+ lines of code) with full attributes for the database columns and tables with 10 classes (one per table) that describe the columns of each table and on class name srdce that has the collections classes for each of the table.

Now open a new C# class library (dll) project in Visual Studio named srdce and add C:\SQLMETAL\srdce.cs to it as a C# class.

Next add references to System.Data.Linq and System.Runtime.Serialization. Now compile once for a test to make sure you got everything right.

Next add a new test project to the solution named srdcetest. Add a project reference to the srdce project to the srdcetest project. Right click on the node for srdcetest and select add/Unit test. This will generate unit tests for all the classes generated from the database.

Next compile the solution to make sure everything works. Now go to the Test Menu and select "run all tests in solution". All the test should fail with a Assert.Inconclusive.

So now we do a little of the red/green/refactor thing. All of our tests fail, so we got red down. Now I want to have a test pass. So goto the SkillsTest method in the SrdceTest class. Change the code to

//IDbConnection connection = "d:\\sqlmetal\\srdce.sdf"; // TODO: Initialize to an appropriate value
Srdce target = new Srdce("c:\\sqlmetal\\srdce.sdf"); // TODO: Initialize to an appropriate value
Table<Skill> actual;
actual = target.Skills;
List<Skill> SkillList = new List<Skill>();
foreach (var Skill in actual)
SkillList.Add(Skill);
Assert.AreEqual(SkillList.Count, 40);

Now go to the using block at the top of the test class and add

using System.Collections.Generic;

Now go back to the SkillsTest method and right click and choose run tests. This should complete correctly.

So we have taken a database, created a class hierarchy for it, created some unit tests, refractored a unit test to be green and basically the result is as follows:

  1. We now have a done a ORM mapping between a database and a C# class hierarchy.
  2. We generated 304 Unit Tests.
  3. We proved that we can select all the data from the skills table and put it into a list for later use in the application. The list is a strongly typed list of the base data type.

Pretty cool, eh?

In later entries I will show how to create a database from the class hierarchy and how to persist data to the database. Finally we will look at how to make the class hierarchy a set of dll's that can be used as plugins in a application.

Friday, November 30, 2007

What's New in .NET 3.5 and VS 2008

In preparation for the Install Fest I am putting together some demos for the .NET users group on some of the new features in .NET 3.5 and Visual Studio 2008. I am sure Jason or Mithun will be providing some slides and presentation from Microsoft, I am just putting together some notes from my last 6 months of working with the betas and the final release. I will add notes as I find interesting things.

NETDUG Install Fest

I got an announcement a few weeks ago from the NETDUG support Mailing list. It is a chance to install the new Visual Studio 2008 product on one of your systems. Specifically Microsoft, the Boise .NET Developers User Group (NETDUG), and the Boise Software Developers Group (BSDG) are having a Visual Studio 2008 InstallFest and Holiday Party on December 6th, 2007 at the Overland Park Cinemas in Boise.

This event is your opportunity to get your hands on the released version before anyone else. Every person that installs Visual Studio 2008 on their computer at the event will receive a FREE fully licensed copy of Visual Studio 2008 Professional in the mail shortly after public release.

Registration link: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032360765&Culture=en-US

Thursday, December 06, 2007 1:00 PM-5:00PM
Overland Park Cinemas
7051 Overland Road
Boise Idaho 83709

Show up if you can. Should be fun.

Saturday, October 6, 2007

Windows Server 2008 RC

I downloaded the release candidate for Windows Server 2008 after my MSDN presentation. I must say that is some pretty cool technology. I found the install much simpler after doing my Windows Server 2003 installs.

I Loaded it into a virtual machine on my Vista Buisness 64 bit laptop.

I just completed configuring it as a Domain Controller, DNS Server, Application Server and IIS Server Pretty cool and pretty easy.

After doing my presentation on WCF (I will blog more on this later) I am especially interested in some of the new options in IIS 7 options for hosting WCF applications.

I will probably end up with several VPC environments to test some stuff out. Right now I am looking at
  1. One where I install the July CTP of SQL Server 2008 (can I install Sharepoint services on this?)
  2. One where I install SQL Server 2005 standard and Sharepoint Services.
  3. One where I install the Orcas Beta 2 Team Foundation Server.

I am also going to configure a client VPC to run Vista Business 32 and the Orcas Beta Team suite.

I am sure I won't get this all correct the first time so I will be playing around with different versions of the server configuration. Nice time to have the 64 bit laptop and the Terrabyte disks. I will save off the VPC in various configurations then copy it back to add software or reconfigure it.

Thursday, September 27, 2007

New Books on Team System

I picked up some books on Team System. Trying to catch up on Microsoft's Offering. Really looking at what it offers versus the Opensource Tools we used at Micron. These are the ones I picked up.

  1. Microsoft Solutions Framework Essentials: Building Successful Technology Solutions. I am curious about MSF vs. RUP or the IEEE standard.
  2. Working with Microsoft Visual Studio 2005 Team System. Had to pick up the final version of this since Richard wrote it.
  3. Software Engineering With Microsoft Visual Studio Team System
  4. Managing Projects with Microsoft Visual Studio Team System. Richard recommended this one and Martin wrote it. How can I go wrong :-).

I will do some studying on these after I finish the MSDN presentation on Oct 4th and while I am working on my Certs

Sunday, September 23, 2007

WCF Book

I picked up a new book on Windows Communication Foundation Friday. i wanted some extra material for my talk. I am thinking about putting together some examples and putting the project up on either codeplex or google projects.

CodePlex would be cool because it is a Team Foundation Server. Google would be cool because it is subversion and easier to deal with for those who do not have the Client stuff for TFS.

I will have to think about it...

NETDUG Meeting and Software Patterns

I attended the NETDUG Meeting on Thurs. Sept. 20th. It is always a good meeting. I went to this one specifically to pick up my presentation materials for the MSDN event on Oct. 4th. In addition they had a INETA speaker there and I wanted to hear what he had to say about MVP patterns and ASP.NET.

The talk was titled Separation of Code and UI with MVP, by Scott Cate. Scott is a very dynamic speaker and I enjoyed some of the talk but once he really got into the discussion of Model Viewer Presenter I got bored and left to talk to the Microsoft reps. My problem with MVP is I learned it as MVC in my smalltalk days. Now most material on MVC/P is old hat. I agree with Scott however, you have to keep talking about it. Some developers never learned it.

I find myself going back to the tools more and more. Good tools support good practices and promote use of patterns. Poor tools do not. Fowler has always had some good discussion of patterns and some good documentation but it is hard to visualize software patterns until you get a good clean code example. This goes against what most pattern authors are trying to achieve since it brings implementation issues into what is purely a architecture discussion.

I believe in some case it makes it clearer. I will post a few patterns and their implementations that I have found helpful over the next few months.

Thursday, September 13, 2007

Windows Live Writer

I have switched away from the blogger interface and am using windows live writer to write my blogs entries now, Very nice.

One thing that does bug me though, none of the windows live betas will run on my 64 bit Vista box. What's up with that?

Windows Communication Foundation

I will be doing some studying and blogging on WCF over the next few weeks in addition to working on my MCPD. Should make for interesting times.