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.
The life, opinions and thoughts of a Traveling Software Developer and Architect
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.
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:
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.
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.I will do some studying on these after I finish the MSDN presentation on Oct 4th and while I am working on my Certs
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...
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.
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?
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.