There's a ton of great new features in VS 2008, for Web development, OBAs, data access, devices and so on, all of which will help to make developers more productive - I've blogged about some of them already and will do more in the future, but today when I was looking at the new support for Code Metrics in 2008 I was reminded of what people used to say about eXtreme Programming when it first hit the scene, viz. that it was gestalt, the sum was greater than the parts. The implication was that in order to reap the full benefits of the process you had to embrace every part of the process, from the readily acceptable (short iterations) to the downright uncomfortable-with-the-idea (pair programming). The message was, put aside your scepticism, give it a whirl and judge it on its results.
Now obviously Team System is a different animal completely, but if you look closely at some of the new features in VS 2008 you can see that there's a case for a similar argument to be made. Take Code Metrics for example. I first used Code Metrics tools about 5 years ago and I initially approached them with a level of scepticism that I could probably sum up as : "Pah! Code Metrics? I know what I'm at!" Until I saw what they could do for me, and in a nutshell that was
In VS 2008 Development Edition you gather code metrics as shown below. Just select either an individual project or gather them for all projects in your solution.
After the paint dries you end up with a results window that looks a little bit like the below, which is a snapshot of the Code Metrics for the AJAXControlToolkit library from codeplex (check out the nice green Maintainability Indices!).
You can drill down into types and methods / properties as shown below:
You get 5 metrics:
In and of themselves the metrics are interesting...but in the context of the whole being greater than the sum of the parts, think about how you would use them. If your code coverage for example has plateau'd (i.e. you have a lot of red areas when you view a file after gathering coverage stats), then have a look at the cyclomatic complexity for the class or method in question. The higher the number the more paths through the code and the harder for your test to exercise every line of code. Similarly if you've got high class coupling figures you may have code smells like Long Parameter Lists that you would want to refactor.
I hate the word "synergy" and there should be a swear jar for "dovetailing", so let's just say that the features complement each other nicely. In the Development Edition along, think of the "complementing" possible between unit testing / performance profiling / code metrics / static code analysis and refactoring. All really useful in their own right, but add them together and you've got something really powerful.
This is an interesting feature I came across as a result of a question in a meeting last week : the gist of the question was can you simulate different types of networks as part of a Load Test. I knew you could adjust the Browser Mix and things like how the load was ramped up, but wasn't sure about the network type, so we had a quick look and you can adjust the Network Mix, as shown below:
Pretty nice, no? I'm going to make sure to include this in any demos of Test Edition from now on.
Want to know what's going to be in Vista SP1? Have a read of the Windows Vista SP1 White Paper...The SP1 beta will be available in the next few weeks. Did you know that by July 2007 Vista supported nearly 2.2 million devices? Beyond application and driver compatibility there are signficant improvements in the area of security, reliability and performance.
And I don't know about you but it's a relief to know that there will be an Elliptical Curve Cryptography (ECC) pseudo-random number generator. Yeah, I had to look it up too.
As you can probably tell from the title of my last few posts I've been doing some work with LINQ over the last few days. Your life will be a lot easier if you learn about some new features in C# 3.0 before getting into it, so here are some resources I've found useful and I hope you will too:
The next four links are to a series of posts by Scott Guthrie which I found extremely useful:
If you want to get even more detailed you could try the C# 3.0 spec.
At that stage you might want to see how to build a LINQ provider. You'll need to know your expression trees though!
Mashup Camp and Mashup University were due to take place in a few weeks at Trinity College from September 10th to September 13th. There is more information here on why the events been postponed, however you are still encouraged to reserve your spot so they can get an accurate count of attendees. The current dates are still unknown, but they are targetting November.
If you haven't heard of Mashup Camp yet, you should go check it out! This is the first time it will be in Europe, so it will definitely be exciting! About Mashup Camp has more information on the event, what to expect and who should go. Looking at the session listing and feedback from the previous event this year in Mountain View, California, there will be some great topics on web development, web 2.0, and of course, creating Mashups.
I'll be there speaking about Windows Live Services, Silverlight, and Popfly. If you have questions about any of those, or if there are things you want to see in the presentations, please feel free to e-mail me. And if you are interested in web development, mashups, or perhaps you just want to know what "Speed Geeking" is, I highly recommend you attend!
I came across this website today and thought it was great. It's called The Podium '08, and it uses Live Search and Silverlight to display a variety of information on U.S. presidential candidates for 2008. On the right side is a list of top issues, clicking on them will give you the candidate's stance on the issue. Across the top are listed the candidates, and clicking on them will give you the latest news from Live.com regarding that particular candidate.
I think this is a great way to use technology to compare and contrast candidates and their issues. I know this presidential race will be interesting too, so it's never too early (for me anyways) to start gathering information.
Have you seen Popfly yet? It's a cool tool for designing and creating mashup and webpages, and it's built with Silverlight technology, which means that you can write and display your mashup on almost any browser and platform! It's still in alpha (and I have five invites if anyone is interested...), but there is a lot you can do with it so far, and it's a lot of fun to play with.
This is the Projects page, which lists the projects that I have created so far. Popfly lets you design a number of projects which incorporate different blocks, and then you can use them, combine them, edit them, basically do whatever you want with them.
Then we have the mashup creator interface. Popfly has this concept of "Blocks" which anyone can write. They are pieces of javascript which interface with some other web service to provide information. So there are blocks for things like Virtual Earth, Twitter, Flickr, Facebook, and a ton more. In the picture below, I'm using the Facebook Popfly block along with the PhotoSphere Popfly block to create a spinning collection of my friends' pictures from Facebook. With a lot of the applications like Facebook and Flickr, they give you an application key to use to interface with the web services. So I added keys for Flickr, Facebook and Upcoming so I could use my memberships on those sites to grab information.
And here's my final app! The pictures here are my friends' id photos from Facebook, and as I move my mouse, they spin around in response to it, getting faster or slowing down and changing direction as well.
There's a lot more to showcase with Popfly regarding the blocks and how you can create your own block, so I will leave that to another post.
If you're interested in a Popfly Alpha membership, e-mail me. First come, first serve!
I recently recorded a screencast on Javascript debugging (haven't put it up yet, watch this space) but one of the things that I covered was debug visualizers, which are a great alternative to the text-only property-name/value way of viewing state when debugging. If you're using LINQ with Visual Studio 2008 beta 2 you can download a LINQ to SQL Visualizer which is a useful way of viewing the SQL that is created behind the scenes for you when using LINQ.
You use it in the same way as other debug visualizers; if you have it installed, when you hover over a query you will see a little magnifying glass as shown below:
Click on it to pop up the debug visualizer which shows you the T-SQL that will be executed. You can edit as you see fit, but if you read my post on LINQ performance you'll know that the out of the box performance is pretty good.
Good as the above is, my favourite thing is part of standard debugging support (i.e. not related to the visualizer). Note that in my example above if you expand the products variable in the watch window you get a nice view of instances of the anonymous type created in my LINQ query, with the types and values of the Code, ID and Name properties all displayed. Oh, and while this next one isn't a debugging feature I just wanted to say that I got intellisense of my anonymous type within the IDE when I was writing the query. Very cool!
Wow - Ireland really cleaned house at the Imagine Cup finals! Team Red Dawn (Mohammed Al-Tahs and Marouf Azad) from the Dublin Institue of Technology finished SECOND in the world for the web development competition! This was out of 155 teams, which is absolutely incredible.
Team InGest (Eric McClean, Mark Clerkin, Cathal Coffey and Daniel Kelly) from NUI Maynooth finished FOURTH in the software design competition, again just a stunning achievement for Ireland's first time entering this competition. There were 55 countries competing in the Imagine Cup 2007 - fantastic job rising to the top! What's more: Team InGest finished in the top six of the BT Innovation Accelerator, which means they are closer to turning their sign language software solution into a business reality.
Imagine Cup 2008 will be held this time next year in Paris - Ireland will be ready! Many thanks to Liam Cronin along with the team mentors, Bryan Duggan and Tom Lysaght!
I just came across AJAXView which is a dev tool from Microsoft Research aimed at giving developers visibility into how their web apps perform in end-user's browsers.
The important thing to note is that you do not need to modify the web-app code or the client-side browser. Basically what it does is to insert server-side proxy which automatically inserts instrumentation code into the web application's Javascript as it is being sent to the browser. This instrumentation provides visibility into the application's performance, behaviour and critical state, while the on-the-fly instrumentation allows AjaxView to serve different instrumentation across users and over time. That's how it gathers the information, but like most performance profiling tools the crux is in how the information is presented so that you can actually make sense of it. AJAXView seems to do a pretty good job, presenting a URL-based view which you can drill down into to examine the javascript functions defined there, along with associated statistics.
It looks pretty neat. You can follow a complete walkthrough of the tool here, covering how to set it up and how it works.
I've been meaning to dig into LINQ performance for some time (actually since it came up during one of my interviews for this job), so I was interested to read a sequence of posts from some of the C# team, tracing the performance of LINQ to SQL from the May 2006 CTP (it was called DLINQ back then) up to early July 2007 (around beta 2 timeframe).
Back in May 2006, for the test in question LINQ to SQL was performing at 14.09% (approx ;-)) of the underlying SQL provider - you'd expect it to be slower than the provider, but that was quite a bit slower. Since then internal changes have got this figure up to 53.56% for the same code. But it's when you use LINQ compiled queries that things start to get interesting - I won't steal Rico's thunder by listing the results here, you'll have to read the articles for that (see links below), but compiled queries look like being very useful for queries that are likely to be run many times within an application. They look a little bit like this:
// precompile a query to retrieve a product based on product ID
public static Func<AdventureWorksDataContext, int, tblProduct> GetProductById = CompiledQuery.Compile((AdventureWorksDataContext db, int productID) => db.tblProducts.Single(p => p.ProductID == productID));
// precompile a query to retrieve a product based on partial product name
public static Func<AdventureWorksDataContext, string, IQueryable<tblProduct>> GetProductsByPartialName = CompiledQuery.Compile((AdventureWorksDataContext db, string partialName) => from p in db.tblProducts where p.ProductName.Contains(partialName) select p);
// Use compiled queries
AdventureWorksDataContext adv = new AdventureWorksDataContext();tblProduct product = GetProductById(adv, 1);Console.Out.WriteLine("Product ID {0}, Name {1}", product.ProductID, product.ProductName);
var products = GetProductsByPartialName(adv, "ball");foreach (tblProduct p in products){ Console.Out.WriteLine("Product ID {0}, Name {1}", p.ProductID, p.ProductName);}
So pretty easy to do really (the above code works in VS 2008 beta 2 by the way, you can download the sample project which is attached to this post). Am really liking the intellisense support in VS 2008 by the way, really handy for LINQ.
Here are the links to the performance articles I referred to earlier:
Beforehand I was a little sceptical about how useable it would be, but I was surprised by how responsive it was. There are Developer and IT Pro labs available so you can take Vista for a spin as well.
There are even more virtual labs available on Virtual TechEd, on things like Windows Server 2008, Security, BI in addition to some of the above. Put together it's a great set of resources for self-training as well as evaluating the latest technologies, so if your company doesn't have the budget/time for formal training, you could try working through them instead of reading the sports news ;-)
Recently I was asked how Infragistics controls would play with VS 2008 - the answer is very well, as they are developing for Silverlight, as well as working on a new set of server controls which will work on ASP.NET 2.0 as well as ASP.NET 3.5, codenamed Project Aikido.
The links above are all to standard web pages, but if you want to see a Silverlight and Infragistics online demo, then here's a nice one which covers Aikido, Infragistics & Silverlight and Infragistics & 2008.
I'm doing a lot of demos at the moment and most of the time I'm using VPCs since I can tee things up beforehand, do my demo and discard any changes at the end. Another advantage of this situation is that I can try out combinations of betas / CTPs quickly and easily, and remove any trace when I'm done, knowing that I can head into my next demo with a fully working demo setup with baseline out-of-the-box VS2008 functionality. For example, in no time at all today I was able to try out the August 2007 CTP of Team Architect Power Tools, which requires VS2008 Beta 2.
What the CTP gives you is the ability to use class libraries on Application and System diagrams, so once you've installed the CTP your toolbox includes a ClassLibrary type as shown below in red:
You can drag a ClassLibrary onto the Application Diagram (either an existing one or create a new one e.g. "BL" below) and start creating references to the class library as connections on the AD. For example, below I've hooked up my SearchService web service to the CreditCardValidation class library.
At this point you can set properties on your class libraries (much as you have done in previous versions for web apps, web services, databases etc.), for example the language (C# in my case below), .NET Framework version (note the 2.0/3.0/3.5 choice, we're in Orcas beta 2 here remember) and when you're done just right click your class library and select Implement Application to have a new project added to your solution. If you've done any work with ADs and SDs before then you'll know intuitively how to use the CTP features.
Now the call to action - ask not what the power tools can do for you, but what you can do for the power tools - if you have any feedback, you can do so via the A&D forums.
In my last post I blogged about Tafiti, a Silverlight interface to Live Search. Meanwhile, "traditional" Live Search has a particularly nice UI IMHO. For an example, follow this link: Leonardo DaVinci. The experience is really nice, you can zoom-in/out on the thumbnails, drag images of interest to the scratchpad and you also get a list of related people on the RHS.
Best thing though is that when you click on any particular image, rather than being taken to its associated page i.e. away from your search results, what happens is that the format of the Live Search page changes to that shown below - you get vertical a ribbon-effect down the LHS with all of the images from the original search, while in the centre pane you see the associated page, which allows you to quickly navigate your way through your search results, all the while being able to drag thumbnails to the scratchpad (which will be available to you when you come back). Nice!
Microsoft has announced a new Open Source At Microsoft site to put the spotlight on its strategy for the Open Source development methodology. The aim is that it serves as a gateway for info about open source engagements and activities across Microsoft, so if you want to find out Microsoft's perpective on Open Source, this is the place to do it. Check out the FAQ for the 10,000ft view.
Just a link post really, but there are lots of VSTS case studies available at http://www.microsoft.com/casestudies/search.aspx?ProTaxID=2671. That link will return you the full list, but you can try Microsoft Case Studies to filter based on Microsoft Visual Studio Team System and your Industry, Organisation Size, Country or Date to find something more appropriate to your circumstances.
Cross posted from ronan's blog
Ok, in no particular order, here are 5 features in VS 2008 which are going to save me some time:
Extender Wizard
This is convenient for use with the AJAX Control Toolkit: to add an extender to a given control, just click the to show the popup menu below:
Then choose the extender you want from the displayed list - all the usual ones from the ACT, as shown below, in this case I'm adding a ConfirmButtonExtender for my link button from above:
Add in my ConfirmText of "Are you Sure" and when I click on my link I get the below dialog:
Obviously you could do all this before but it involved going into the ASPX file and hooking up the IDs yourself. This is way easier, also you can easily see what extenders are associated with a given control:
CSS Designer Enhancements
My CSS is on a need-to-know basis so I've often been baffled as to why my page looks like it does. The new CSS support in VS 2008 can help, by highlighting not only the styles that are used on the current page (those with the grey circle in Manage Styles), but also by highlighting what styles in the hierarchy are overridden. Also you get a preview of each style, see Apply Styles below, and you can also filter based on page or current selection.
Handy tip : pressing ESC in the designer will highlight the parent element.
Javascript Intellisense & Debugging
A bit like CSS, for Javascript is another of those on-a-need-to-know-basis areas (search engines are a great help) so Javascript Intellisense is a nice one for me. It's been covered extensively elsewhere, but the transparent Intellisense is a nice touch - just hold down the ctrl key to make the Intellisense popup transparent.
Incidentally, if your Javascript Intellisense doesn't seem to be working in beta 2, check out http://blogs.msdn.com/webdevtools/archive/2007/07/30/workaround-for-beta-2-javascript-intellisense-and-colorization-issue.aspx for a workaround.
LINQ to XML
OK, this is turning into a bit of a confession (and I'm still on probation in my new job!), but XPath is yet another of those on-a-need-to-know-basis areas. I've used XPath a lot for querying docs but it's really a case of use it or lose it and I always have to refer back to the code I wrote the last time I used it. So I expect to make a lot of use of LINQ to XML particularly for querying XML docs, for clarity and Intellisense and compile-type-support. Bye bye XPath, you won't be missed!
It's just plain faster :-)
Switching between source and design view is way better than before.
In a previous post I covered Visual Studio Team Edition for Database Professionals. As of 11th August 2007 you can download DB Pro Power Tools from here. Some of these are really handy, e.g. Static Code Analysis - like an FxCop for T-SQL, and wildcard expansion which will convert e.g. SELECT * into a select from a defined column list.
Here's a quick summary of the tools:
TSQL Static Code Analysis• Static Code Analysis - A precursor to the functionality that will be in future versions of VSTS that will allow you to perform Static Code Analysis on T-SQL code.Refactoring• “Move Schema” Refactoring - Allows a user to right click on an object and move it to a different but existing schema • SP Rename Generation - Generate a new script that will contain sp_renames for all rename refactored objects that the user can then execute. • Wildcard Expansion - Automatically expand the wildcard in a select to the appropriate columns.• Fully-Qualified Name Support - Automatically inject fully-qualified names when absent in a script• Refactoring extended to Dataset - Refactor into strongly typed dataset definitionsMSBuild Tasks• Data / Schema Compare Build Tasks - MSBuild tasks that can generate scripts as if the user had run the Data / Schema compare UISchema View• API Access to Schema View - Insert / Update / Delete to schema View and list schema objects and their associated filesDependency Tool Window• Dependency Tree - Show the dependencies ( incoming / outgoing ) for selected schema objects in a new tool windowMiscellaneous Tools• Script Preprocessor - Expand SQLCMD variables and include files and command line version (sqlspp.exe) & an MSBuild version ( wraps the command line version )
For a detailed explanation, with screenshots, take a look at http://blogs.msdn.com/gertd/archive/2007/08/07/it-is-august-6th.aspx
This just in from Seoul, courtesy of Liam Cronin:
"InGest from NUI Maynooth have made it into the last 6 of the Imagine cup finals. This is unbelievable and we are all over the moon here in Seoul, that in the space of 6 months we have gone from no Imagine cup competition in Ireland, to now be in the final 6 in the world"
All I can say is wow!
Tomorrow the team will be presenting in front of 500 people for 30 minutes to five VIP judges. Best of luck lads!!
Brian Harry has posted what he believes to be the final feature list for TFS 2008. A few interesting ones:
Incidentally, some of stuff on the list didn't make beta 2 but will be in RTM.
Previously I highlighted the beta 1 of this guide, well now the final version has been released and is available for download at http://www.codeplex.com/TFSGuide
In addition to the Parts I-VIII in the beta it also includes a section on Visual Studio 2008 Team Foundation Server, highlighting the upcoming changes in the next version.
I've dipped in from time to time and it's a great resource to have, whether you're starting out or not.
Today I discovered a great blog which is published by Declan Fitzgerald and his recruiting team here in Dublin. It’s called “Microsoft International Tech Jobs”, and it’s all about what goes on here, in Europe and all over the world in Microsoft research and development. There are some very cool videos posted there about technologies Microsoft creates as well as the types of positions available in Dublin and elsewhere. You thought all of the Microsoft product development happens in the U.S…? Now you can find out exactly what goes on outside of Redmond!
Team Edition for Database Professionals (or DB Pro for short) has two main goals:
To achieve #1, DB Pro extends the same ALM capabilities to database professionals that software developers have enjoyed for years, fully integrating them into the development process, as we'll see.
Key to #2 is the addition of two roles to the MSF Agile Process:
These roles frequently resolve to the one person, but a major difference in the roles from DB Pro's point of view centres on access to the production database. As we'll see, the DB Dev role is isolated from the production database and works with a sandboxed database. The DB Admin role has the authority to deploy updates to the production database.
Let's take a look at how all this fits together by working through an end-to-end scenario involving
Throughout we'll use the Process Guidance as an aid. The scenario is that we have an existing database (AdventureWorks) and we are going to start using DB Pro to maintain/enhance it, using the MSF Agile Process, all supported by Team Foundation Server.
Create a new Database Project
Note that detailed help on the workflows for both roles, Database Developer and Database Administrator is included in the updated Process Guidance for the MSF Agile Process. For example, below is a snapshot of the process guidance for Create a Database Project for the Database Administrator role (like all Process Guidance in Team System this appears within the IDE, so the user doesn't need to switch out of the IDE for guidance/help on a particular task.
Below is the New Project dialog box - under Database Projects->Microsoft SQL Server you'll see 4 installed templates. We'll go with the SQL Server 2005 wizard, as handily enough, the steps in the wizard match the Process Guidance with steps for accepting your work item, creating the database project, setting project properties etc.
I accepted all the defaults for Project Properties and Database Options. Of note in the Project Properties here is the "Organise my project by object type" option - as we'll see, when the project is created it will have grouped items into categories such as "Stored Procedure", "Tables" etc. - each item is then a separately controlled artifact in source control with obvious benefits for concurrent changes.
As per our scenario, we are starting from a pre-existing database - so we'll import the AdventureWorks schema and click finish (accepting defaults for Build/Deploy). The result is a new database project, which you can view using either Solution Explorer or Schema Explorer as shown below. The Solution Explorer as you'd expect gives a file-based view of your project, while Schema View is to SQL what say class view is to C# projects. Note that built into the name of each file is it's type e.g. "dbo.uspGetBillOfMaterials.proc.sql" as shown below, which is convenient.
Create a Unit Test
The next step in our scenario is to create a unit test (before we make any more changes, so we can be sure we haven't broken anything). In the Schema View, right-click on a stored procedure and select "Create Unit Tests" as shown below.
This will pop up the below dialog - note that you can create unit tests for sprocs, functions and triggers. I've selected a C# test project, but you also have the option of a VB.Net test project if you wish.
Click OK and the test project is created, along with unit test code in C# and SQL, as shown below. Note that you can specify one or more Test Conditions relating to things like execution time, row count, empty/not-empty result sets and so on. For now, I'm going to specify that the row count must be 0.
Let's run the test and see what happens! As you can see in the Test Results pane below, the test failed, because the returned rowcount was 4, not 0.
The reason for this is that I had inadvertently pointed my test at the production database (my fault!). At this point I have no test data in my sandboxed database, the result at this point for my unit test should really be 0 rows. Remember, you should be pointed at your sandboxed database - if you get a different value back here, change it in the database test configuration dialog. So how do I add test data to my sandboxed database? The answer is to add a Data Generation Plan to your database project in Visual Studio, by right clicking on the tab as shown below:
What this gives me is a list of Tables and a snapshot of sample generated data, as shown below. By default all Tables in the database are selected - I have opted to generate data only for the HumanResources.Employee table. The Person.Contact table is then selected automatically due to a FK relationship between the two tables.
One neat feature to note here is that each column is associated with a Generator depending on the column type. You can change the default Generator (and even write your own) - for example, I've changed the generator for the Title column to use a regular expression generator, and as you can see in the snapshots below that has a knock-on effect on the generated test data. Obviously this is useful when writing your unit tests as you want the test data to be reasonably representative of what you are going to be storing in practice.
Another reason why this is important/necessary is column constraints: for example, valid Marital Status values are "S" or "M", gender values are "M" or "F". In both cases I used a regexp generator. In the case of Person.Contact.AdditionalContactInfo (which is XML) I used a databound generator to select sample data from the production database. (There were others, it's a good learning exercise!) You can test your data generation plan via the Data->Data Generator->Generate Data menu option. It will give you good diagnostic information if/when your plan fails : it's better than just running your unit test and getting an error about a failed data generation plan.
When your plan generates correctly, as shown above, you associate it with your test project via the Database Test Configuration Dialog as shown below. Note the sandboxed database!
Make some changes - refactoring
OK, so now we have a unit test for our stored procedure we can do some refactoring and be sure that we haven't broken anything. To keep it simple let's just change the name of the (only) parameter of the stored procedure.
As you do when, say, refactoring in C#, you get to preview your changes, and click Apply if you're happy.
A quick re-run of our unit test shows we're good to go, so we can check everything in. At this point the DB Admin role can take over and think about deploying the solution - i.e. in our case that amounts to one change to the schema, our single refactor of the parameter name. A quick schema compare via Data->Schema Compare confirms this (note the object-based compare, much better than the old-style textual schema compare):
At this point the DB Admin can Deploy the changes to the production server by changing the target database name in the project, building it and finally running Deploy. Below is a snapshot from SQL Server Management studio showing the updated sproc in the AdventureWorks production database (the one from which I imported the schema originally).
Summary
DB Pro enables the DB developer / administrator with great tools for change control, testing, refactoring and applying updates to production servers. The developer works in a completely sandboxed environment, with the Admin role authorized to apply changes to the production server. Underpinning this is Team Foundation Server which provides full traceability of all changes. All in all, quite neat!