Software Development

Healthy Debate on “Software Craftsmanship” and Elitism

A good debate between Ted Neward and Uncle Bob Martin regarding "Software Craftsmanship". I find the debate to be very worth the (long) read. - Ted points out that we need to not be Elitist and egotistical about our approach and skills. Amen. - Bob's goal is to institute some principles that help the industry mature; that help us all improve. Ted's Original Article: "On The Dark Side Of Craftsmanship" Bob's Response: The Craftsman And The Laborer Ted's Reply:...

posted @ Monday, February 11, 2013 8:00 AM | Feedback (1)

Standing to Code

Today I tried a Standing Desk for the day. I've heard about this a number of times, mostly on Twitter. The idea's not new, but it is gaining attention due to the health concerns around so much sitting. I started standing at 7am. It's currently 3pm, and I'm still standing here. So far so good. My muscles are a little tired, but my mind feels more awake than most other days! Another thing I'm noticing is that it's a lot easier to switch gears. If I need to step over for a cup of coffee, I'm already standing....

posted @ Tuesday, March 20, 2012 3:12 PM | Feedback (3)

SqlTransaction Ain't Always Transactional

Q: "SQL run using a SqlTransaction is part of a SQL Server Transaction and can be rolled back." A) True B) False The answer is of course "A", right? That's what I thought too. Basic SqlTransaction Usage Most of us assume that we can write this: using (var con = new SqlConnection("..")) {   con.Open();     using (var tran = con.BeginTransaction())   { ...

posted @ Saturday, March 03, 2012 10:03 PM | Feedback (26)

Updated version of Monitored Undo Framework released

Today I released an updated version of the Monitored Undo Framework. Changes include: A new parameter on the DefaultChangeFactory's methods for specifying the "description of the change". This can be helpful in cases where the UI shows a list of the undo / redo changes. A new WPF sample that shows, in a simpler codebase, how to use the framework. Updated build script that compiles all solutions, run the tests, and package the NuGet package. These changes are also available via NuGet. Cheers!

posted @ Tuesday, January 31, 2012 10:24 AM | Feedback (0)

"tfpt unshelve /migrate" Doesn't Account for Renames

A quick note about Team Foundation Power Tools (TFPT)'s "Unshelve" command… tfpt unshelve has a /MIGRATE switch that will allow unshelving changes into a different branch / location than the one where they were originally shelved. I won't re-iterate the many articles describing how to use this command. One issue that I ran into is unshelving a set of changes into a branch where some of the shelved files had been renamed / moved. It seems that the /migrate switch doesn't go back into TFS version history to locate the renames. Instead, it simply pulls out the changes...

posted @ Thursday, January 26, 2012 4:14 PM | Feedback (0)

A Visual Studio Extesion to make Scrolling Better!

Hi All, A friend of mine (John Nastase) saw a tweet or two of mine complaining about scrolling in Visual Studio. What did he do? He wrote a VS extension to make it happen!!! Here's the extension that he just published in the VS extension gallery. It basically adds a "cursor buffer" space to the top and bottom of the window so that as arrow down the page, the page starts to scrolling before the cursor hits the VERY BOTTOM OF THE PAGE. Instead, it starts scrolling a little earlier so that you can see what's coming. This saves you from scrolling too...

posted @ Monday, January 23, 2012 10:37 PM | Feedback (0)

EF Inserts Failing Because of Missing Association in SSDL

I just found that Entity Framework (4.0) can stumble on One-To-One relationships if the EDMX's schema storage layer (SSDL) is missing the association that represents the Foreign Key in the database. I suppose this makes sense, but it's only obvious to me in hindsight. I don't know how my EDMX ended up missing the SSDL association for the Foreign Key, but it was missing. However the the Conceptual Layer had the relationship, so the diagram made it look like it was associated. And because this is a supported scenario, it didn't complain at me that I was missing anything....

posted @ Thursday, January 19, 2012 4:37 PM | Feedback (0)

Microsoft's MVP program and Rob Eisenberg

This is a long read, but it's got some detailed insight on the MVP program at Microsoft. I've heard these sentiments before, and I'm sure that it's not black and white. Regardless, Microsoft's actions in this case are unacceptable. http://devlicio.us/blogs/rob_eisenberg/archive/2012/01/04/how-i-lost-regained-and-then-turned-down-an-mvp-award.aspx If you don't know Rob Eisenberg, he's the creator of Caliburn and Caliburn Micro frameworks for XAML based platforms (WPF, Silverlight, WP7). If you want to have your mind blown, take a look at his source code for Caliburn Micro (and even more so for Caliburn). While you're at it, watch his "Build your own MVVM framework" presentation....

posted @ Thursday, January 05, 2012 2:34 PM | Feedback (0)

Good Times at the .NET SIG…

Had a great time at the .NET SIG last night where we talked about Software Craftsmanship and did Katas together. We had a good turn out (~40 attendees), and we spent a majority of the time doing Katas. I was quite impressed by the group's willingness to try Pair Programming. Here's pic that Andrew Thorne snapped of one side of the room. You can see people working on a kata, mostly in pairs! https://twitter.com/#!/Bennett_Adelson/status/146744206772281345/photo/1/large   Thanks to those of you who came out. Hope you enjoyed the time and got something out of...

posted @ Wednesday, December 14, 2011 8:15 AM | Feedback (0)

Signing EXEs and MSIs with Signtool via TFS Builds

I won't repeat the "Signing your code with Signtool" walkthrough that is already detailed in 50,000 other posts. You can Bing that with Google as easily as I did. What I will share is a little issue that tripped me up for a bit. I wanted the code signed as part of the TFS automated build. And, while I could run the command line myself, I could not get it to work under TFS builds. The Scenario I wanted the keys in the certificate store, rather than on disk. This makes it possible...

posted @ Friday, November 18, 2011 3:23 PM | Feedback (2)

LINQ to Excel = Bliss!

It's fun when an API is so awesome that it just makes you smile uncontrollably. That's how I felt after using Linq To Excel! http://code.google.com/p/linqtoexcel/ I dreaded the thought of coding against Excel and decided to search around for the best approach. StackOverflow served up a couple options, including LINQ to Excel. Now I like LINQ, so it naturally attracted my eye. The project is completely awesome! It let me extract data from multiple sheets in an excel workbook with just a few lines of code, and no direct dependency on Excel to be installed on the machine!...

posted @ Tuesday, November 08, 2011 11:28 PM | Feedback (0)

Poor-man's .NET Linker = Embed Your Dlls

I had a need to create a simple .NET app, but it needed to be self contained in a single EXE. Native developers (C / C++) can easily create single EXE programs by utilizing the linker to pull the various pieces into the EXE. Not so easy for .NET. I remembered reading about options for this in the past, and decided to take the quick & easy route. Options that I've heard of include: Use the Mono tooling to "link" the dlls into the exe Hook "type-resolution" events and locate the...

posted @ Thursday, November 03, 2011 3:17 PM | Feedback (0)

Don't Reuse Context with Entity Framework Self Tracking Entities

With EF Self Tracking Entities, it appears that using a single context for a "read" and then a subsequent "save" does not work. I guess I could let this one go as "By Design", but that doesn't mean I have to like it… The Scenario: EF Self Tracking Entities for an MVC 3 site I have an MVC3 site wherein I'm using Self Tracking Entities. These are exposed by repositories that I'm injecting into the controllers via Ninject. Since we're letting our IoC container create these items, the lifetime of the instances are "per request". Inside the...

posted @ Tuesday, November 01, 2011 1:27 PM | Feedback (1)

Making Sense of WinRT - Part 1 - I like it, BUT...

Build 2011 was amazing! It answered some lingering questions (XAML's future, Tablets, etc). It also presented us with some very impressive and fresh work that should ensure a bright future for Microsoft and the MS ecosystem. In a Post-Build time-frame, I'm looking back a bit and reflecting on what this all means. A couple thoughts come to mind... C++ Renaissance - Not a coincidence... The backing from MS for the "C++ Renaissance" and the "Going Native" movement are making a lot more sense. Initially, I kinda felt like these were unrelated to announcements that might be coming at Build. But looking back,...

posted @ Thursday, October 27, 2011 12:00 AM | Feedback (0)

TFS Power Tools - Searching for Work Items!

TFS Power Tools was just updated and released on August 18th. The new version includes a feature I've really been missing: Work Item SEARCH. How could this have been missing for so long? Well now it's in the TFPT. It's a little hidden. You have to use the Work Item Tracking toolbar to do the search. So if you've hidden most of your toolbars like me, then you'll need to show it again to see the search. Here's a good overview from Brian Harry's blog about what's included. You can grab the extensions from the gallery. ...

posted @ Friday, September 02, 2011 9:00 AM | Feedback (0)

MUF Runs on Windows Phone 7 and Silverlight 4

I am happy to report that the Monitored Undo Framework (MUF) now supports Silverlight 4 and Windows Phone 7! Today I did some maintenance on the framework in preparation for publishing it to NuGet. As part of the maintenance, I added binaries that target additional frameworks, including new support for: Windows Phone 7 Silverlight 4.0 .NET 3.5 It was pretty fun to see the same library working across all these platforms! Windows Phone 7… Silverlight 4 WPF (.NET 4.0)...

posted @ Saturday, June 18, 2011 11:58 PM | Feedback (11)

Monitored Undo Published to NuGet

In the words of James Brown…. I feel good! Why? Because today, I updated Monitored Undo Framework (MUF) and published it to the NuGet feed! Now I feel legit and official. I really like NuGet for a number of reasons… Convenience, time savings, and more. But one of the best things about it is just browsing the catalog! I found some really cool stuff in there that I wouldn't have otherwise stumbled on. Sure, one can Google with Bing or search codeplex or GitHub, or whatever. But if you find something in NuGet, it sort of...

posted @ Saturday, June 18, 2011 11:55 PM | Feedback (1)

Bye bye Ad Sense

I'm saying goodbye to Ad Sense on my blog. I put it here as an experiment to understand how it works. I don't think anyone will be surprised to learn… It didn't. I don't have crazy traffic to my blog (yet). And my target audience… programmers… who DON'T click on ads. Ugh. Well, the blog looks better without ads anyway. Cheers

posted @ Sunday, May 15, 2011 11:53 PM | Feedback (0)

Trouble for the Mono team and projects…

EDIT: May 9, 2011 The latest I've heard is that the original layoff reports may have been a bit speculative. There has been nothing from the Mono team yet (that I've seen) to confirm or deny any layoffs. The little that has been said is that any existing product roadmaps will stay in place. I suppose this means that Mono has some life left. I'm hoping for the best, but still concerned about Mono's future.   Attachmate recently bought Novell. This also meant that they got the Mono team, including Mono, Moonlight, MonoTouch, MonoMac, and MonoDroid. Layoffs… It sounds Attachmate doesn't want anything Mono...

posted @ Wednesday, May 04, 2011 10:16 AM | Feedback (0)

Twisten 1.0 - Listen to Twitter

What is Twisten? Twisten is a twitter client that lets you listen to your twitter feed via Text-to-Speech using the built-in speech features of Windows. Why use It? Listen to twitter in the "background" while you do other stuff! The benefit of listening in the background is that you don't have to completely shift your focus away from your work to consume the tweets. Less context switching means you can stay productive, but still switch focus if you hear something that catches your attention. Download and Installation Getting Twisten is easy! It's a "Click Once" application,...

posted @ Tuesday, April 12, 2011 12:00 AM | Feedback (7)

WPF - Grid SharedSizeScope Doesn't Honor MaxWidths

I'm always hesitant to call something a bug because often it turns out to be my own misunderstanding. So I won't call this a bug yet, but I'm close… I sometimes use Grids inside of DataTemplate for an ItemsControl or a ListBox as a means to get a "column" effect for the elements. In this case, I set the parent with a Grid.IsSharedSizeScope="True" and then set the SharedSizeGroup on the ColumnDefinitions in the DataTemplate. Maybe there is a better way, but this works well for many cases. Recently, I ran into a case where I wanted the contents...

posted @ Wednesday, March 16, 2011 8:00 AM | Feedback (3)

SymbolSource.org - PDB and Source for OSS

Another thing I learned from Sebastien Lambla was the existence of SymbolSource.org. This site provides a symbol server for third party .net libraries. This is the same idea as what MS released to allow stepping though portions of the .NET framework's source code. SymbolSource.org allows other libraries to post their PDB and source code files to a standardized symbol repository that can be hooked in to Visual Studio. This means that VS will query the symbol server if you attempt to step into a library that has symbols on this server. It looks like both OpenWrap and NuGet may...

posted @ Thursday, February 17, 2011 10:25 AM | Feedback (0)

Do you know about Sebastien Lambla? You Should!

Just listened to Herding Code #103 with Sebastian Lambla on the way into work. Really wishing today was a holiday because I just learned about a TON of really cool stuff to explore and try! Sebastien Lambla is driving a number of game-changing projects including: OpenRasta  A framework that enables creation of RESTful services and sites. Can be used to create simple REST services, or full sites. Very rich, highly composable, and extensible. OpenWrap ...

posted @ Thursday, February 17, 2011 9:54 AM | Feedback (0)

My CodeMash 2011 Recap

CodeMash 2011 was great!! I really enjoyed the talks, the venue, the food, and the chance to meet up with friends. So, in an effort to remember everything, I'm recapping things on my blog. This is not exhaustive, nor is it all that polished. It's kind of a high level summary with links to resources as appropriate. Here is Part 1 of 2, which covers Wednesday and Thursday. Friday's notes are still in my nice little Moleskine notebook that they handed out at CodeMash. My Sessions Here are the sessions that I attended at CodeMash 2011. The links point to the info from...

posted @ Sunday, January 16, 2011 11:10 PM | Feedback (0)

Cancelling BackgroundWorker - Don't watch e.Cancel

Just a quick note about an issue that seems deceptively simple to introduce… If you are using the BackgroundWorker in your app and you've set it up to support cancellation, be careful how you write your code that watches for cancellation. BackgroundWorker has an event DoWork, which passes DoWorkEventArgs. This derives from CancelEventArgs, which has a property named Cancel. The unsuspecting developer (like me) might assume that e.Cancel is the property to check for detecting if the work has been cancelled. You might write something like: while(!e.Cancel) {  ...

posted @ Friday, January 07, 2011 4:32 PM | Feedback (5)

WPF & Entity Framework 4 - Tales from the Trenches

I recently presented "WPF & RF4 - Tales from the Trenches" at the Cleveland .NET SIG. This presentation reviews tips, tricks, and lessons learned from building real world apps with Windows Presentation Foundation 4.0 and Entity Framework 4.0. Whether you’re doing desktop, Silverlight, or web development, the EF T4 template tweaks, MVVM usage, Undo/Redo implementation, and Reactive programming tips reviewed in this presentation should come in handy. The Photo Tagger sample application includes implementations of these topics and issues. I'd highly recommend pulling this down and taking a look. Downloads WPF...

posted @ Wednesday, October 13, 2010 7:00 AM | Feedback (6)

MUF is Live on CodePlex! (Monitored Undo Framework)

The Monitored Undo Framework (MUF) is now available on CodePlex! First of all, I'd like to offer a a big thanks to my client, who allowed me to make this available. MUF is a library for implementing Undo / Redo. It was written in tandem with a WPF application, but should work ok in Silverlight too. The "Monitored" part of the name refers to the way it builds the undo / redo stacks. It does so by monitoring the property changes in the model (or view model, or whatever) and adding a change item into the...

posted @ Wednesday, October 06, 2010 10:58 PM | Feedback (4)

.NET SIG: "Bag O' Tricks - WPF and Entity Framework" (Oct 12th)

Just wanted to plug my upcoming presentation at the Cleveland .NET SIG…. Oct 12th at the Microsoft offices in Independence, OH. Topic will be "Bag O' Tricks: WPF and Entity Framework" I plan to share lessons, tips, and tricks from my experiences with WPF 4.0 and Entity Framework 4.0. Even if you aren't using WPF, I think you may find these topics useful since many are are also applicable for other technology stacks, including Silverlight, Windows Phone, Windows Forms, and even web apps. EF Self Tracking Entities ...

posted @ Friday, October 01, 2010 10:41 AM | Feedback (0)

Windows Phone 7 not Launching on Verizon!!!

Apparently, Windows Phone 7 will not be available on Verizon they year! I'm not one for profanity, but WTF! Sure, from a global perspective, it makes sense, but I'm just a poor little American, stuck on [the not so small] Verizon network. Sounds like I'll have to wait until 2011 to get a WP7 device. My phone contract is up and I'm in the market for a new phone. I've been holding out, and holding out, and holding out, stretching that Microsoft loyalty for all it's worth... thinking that I'll give WP7 a look. "Holiday 2010" has been a long wait,...

posted @ Wednesday, September 22, 2010 12:00 AM | Feedback (0)

Stop the Mediocrity…

“Art & Copy” just shattered my status-quo. While the film is essentially a documentary about the top advertising firms, I found it overflowing with inspiring and challenging ideas from the best in the field of advertising. The men and women from these firms are brilliant. They literally defined some of the culture that we all take for granted. While diverse in background and approach, each has the task of connecting to their audience, usually with the goal of affecting change or action. Each uses different styles and comes with a different perspective. And yet, they share...

posted @ Friday, August 20, 2010 12:32 AM | Feedback (0)

Preventing Inlining for Code that Inspects the Stack Frames

There's a first time for everything. Today, I got to use the attribute that prevents a method from being inlined. There's a good post, including a bit of a warning, on the MSDN forums regarding the issue and solution. In my case, I was looking at the call stack to get the current method, so that I could pull some metadata attributes off of the method. Worked well until it hit the build server. Then the unit tests started failing. Adding the [MethodImpl(MethodImplOptions.NoInlining)] attribute did the trick. If you're going to try this, I'd recommend the...

posted @ Saturday, August 07, 2010 1:08 AM | Feedback (0)

Faster Builds from Visual Studio

Just a quick note on something that helped me get my solutions builds to run faster as I develop. First off, I’ll admit that “Faster Builds” is a bit of a stretch. I’m not actually making VS compile faster. Rather, I’m reducing the amount of time I waste waiting for a build to complete. Time Consuming Builds… Some solutions have a ton of stuff going on in their compilation process: Numerous projects (presentation, business, data, etc) Unit tests (maybe one per project) Static code analysis ...

posted @ Tuesday, June 15, 2010 12:00 AM | Feedback (10)

Be careful about with e.Handled in mouse or keyboard events

Today, I finally resolved an issue that I thought was related to WPF’s focus implementation. For some reason, I couldn’t get certain elements to get focus when I clicked on them. This was messing up a number of other things, including keyboard interactions and routed commands. I thought that I had some strange scenario that was preventing focus from going to my canvas. Maybe some issue with FocusScopes? Maybe the control wasn’t Focusable? It turns out that I had a number of event handlers set up for clicking, dragging, etc. In these, I was setting e.handled = true. Not...

posted @ Thursday, June 10, 2010 3:54 PM | Feedback (0)

WPF Routed Commands + MVVM

A lot of the MVVM guidance around commands suggest using a generic ICommand implementation, such as the RelayCommand or GenericCommand implementations. These are great for UI pieces that are bound directly to an underlying ViewModel and I use them frequently. There are still cases where a RoutedUICommand is exactly what one needs. Take, for instance, toolbar buttons or menu items that need to act on pages that are loaded in a WPF frame. In this case, a RoutedUICommand is appropriate since it is decoupled from the page, which may or may not be loaded at the time. ...

posted @ Thursday, June 10, 2010 3:44 PM | Feedback (0)

Stuff hitting my “Radar”

I recently started listening to the Herding Code podcast and BoagWorld podcast and have subsequently been exposed to some really interesting “stuff”. I thought I’d put these down, if for no other reason than helping me remember to try them out. JSConf Javascript is getting a lot of attention and investment lately. This is both in the browser and on the server. There are a ton of cool things going on, many of which are discussed at JSConf. One of the trippy things I heard about is a JS library that will rip flash into HTML5...

posted @ Thursday, June 10, 2010 10:18 AM | Feedback (0)

WPF Style and Template Resources – Order Matters

When working with WPF resources, remember to declare the resources in the correct order. A style or template that is referenced elsewhere must be defined before it can be used. In other words, if Style1 uses BrushA as a StaticResource, then BrushA must be defined before Style1. Otherwise, you’ll get fun errors like: Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.Windows.FrameworkTemplate' It may be common knowledge, but it can be a real pain to diagnose. This is especially true if you have a large set of template and styles for...

posted @ Friday, May 07, 2010 4:44 PM | Feedback (5)

MVVM ViewModel Locator via WPF Converters

Laurent Bugnion’s work on MVVM Light introduced me to the ViewModel Locator pattern. The concept and implementation are really slick! From my perspective, ViewModel Locators do the following: Provide a simple, declarative way to connect a View to a ViewModel (duh). Enable design-time support, including the ability to connect an alternate data source behind the VM (cool!). I want a solution that lets me: Connect my XAML views to their associated ViewModels Handle a somewhat complex model with a hierarchy of domain model entities and...

posted @ Thursday, May 06, 2010 12:05 AM | Feedback (3)

Cancelling Selection Change in a Bound WPF Combo Box

Scenario A user selects a new value from a WPF combo box. You ask if they are sure they want to do this. User says “No”. WPF app is built with MVVM such that the combo box’s SelectedItem is bound to a property on the ViewModel. In the setter, you prompt the user and attempt to cancel the selection by discarding the new selected value. Here’s the UI XAML <Window x:Class="WpfComboBoxCancelSelect.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Cancellable...

posted @ Sunday, April 25, 2010 4:38 PM | Feedback (17)

I <3 LinqKit – Dynamically build arbitrarily complex Linq Queries

In some cases, I need to be able to build a query that has a variable set of OR conditions. This is not simple with the default language constructs and extension methods. It’s simple to dynamically build an expression that includes AND parameters, because that is what the WHERE() extension method does. Not so easy for OR’ing together a bunch of conditions. Enter LinqKit. This is a great library. It provides some easy to use (but powerful) extension methods that let you “Or()” some conditions together. A common case is where you get a list of values that you need to add into...

posted @ Wednesday, April 14, 2010 11:42 AM | Feedback (0)

Entity Framework 4.0 doesn’t enforce MaxLength metadata

I’m a little flabbergasted that Entity Framework does not do anything to enforce the MaxLength on string values. It just passes this responsibility down to the database and catches the resulting (unhelpful) exceptions. I suppose that there is a justification for this, but from an notably simplistic perspective… Why should I start a transaction and waste precious DB resources, only to get some generic “String or binary data may be truncated” error message back. It would be trivial for EF to use the metadata to ensure that you cannot push a 10 character string into a field that...

posted @ Tuesday, April 13, 2010 3:42 PM | Feedback (3)

NativeMethods classes are special

“Whatever doesn’t kill you makes you stronger” That’s how I feel about Code Analysis. It’s painful, but in the end, it teaches me stuff that I didn’t know or hadn’t thought about. Richard Broida challenged me to see if I could rework some WIN32 P/Invoke code to get it to pass Code Analysis rules. My initial response was pretty close to whining, but I recovered from my temper tantrum and did some investigation. Luckily, I didn’t have to look too far… The info on the rule “CA1060:MovePInvokesToNativeMethodsClass” provided some useful guidance and explanation. So I created a class in my project called...

posted @ Monday, March 15, 2010 3:07 PM | Feedback (0)

Who knew overriding GetHashCode() was so much fun?

So, I have a project with Code Analysis turned on and it treats warnings as errors. In this project, I have a class that overrides Equals() so that I can use some of the nice collection based linq expression (like Except()). Well, code analysis doesn’t like it if you override Equals, but forget to override GetHashCode(). Needless to say, I have to override GetHashCode(). But how does one do this? Some searching turned up a bunch of interesting resources showing how to do this. However, there isn’t some cut and paste code that solves the problem. You have...

posted @ Friday, March 05, 2010 2:23 PM | Feedback (0)

Making WPF Remember Window Size, State, and Position…

I had a need to make my WPF app remember it’s size, position and state for the main window. A bit of “Binging” and I eventually heard the sound of found. Turns out there are a couple ideas out there, but the WINDOWPLACEMENT solution from MSDN seemed to fit the bill the best. This solution requires using some WIN32 API calls to get and set the information. The upside is that it seems to leverage the smarts built in to Windows regarding multi-monitor detection. The sample says that if the app was previously displayed on a secondary monitor that...

posted @ Thursday, March 04, 2010 11:15 AM | Feedback (1)

Except() Extension method Returns the “Difference”

Maybe I’m late to the party, but I just found the Except() LINQ extension method. I knew I loved .NET! For those of you familiar with set theory, this returns the “difference” between two collections. In my case, I needed to append a set of items to an existing collection, but only if they’re not already in the target collection. This thing was just what I needed. Here’s the definition: // // Summary: // Produces the set difference of two sequences by using the default equality // ...

posted @ Tuesday, March 02, 2010 5:44 PM | Feedback (0)

Should the Domain Model implement INotifyPropertyChanged?

I’ve been discussing an architectural question with a colleague this week. The scenario includes a WPF application, Domain Driven Design and MVVM. The goal is a relatively “pure” domain model where the classes in the model do not depend on any UI specific or other external assemblies. They are pretty much pure “POCO” objects. The question is whether it’s reasonable to have the domain model implement INotifyPropertyChanged and INotifyCollectionChanged (via ObservableCollection). INotifyPropertyChanged is defined in System.dll. It’s part of System.ComponentModel namespace. INotifyCollectionChanged and ObservableCollection are both in WindowsBase.dll. These are in System.Collections.Specialized and System.Collections.ObjectModel respectively. My take… go for...

posted @ Friday, February 26, 2010 12:20 AM | Feedback (4)

Skinning WPF – Call InitializeComponent in App.Xaml

For the past two days, I’ve been trying to get the infrastructure in place for skinning a WPF application. My goal is to support multiple skins and swap them out dynamically while the app is open. I could get the skin to affect the UI if I set it in the main window’s resource dictionary. However there was a quirk… The application uses WPF frames and pages. The skin was not showing up on frame’s pages. It would only show up on the main window. I searched Bing, Google and StackOverflow for answers. No luck. I...

posted @ Thursday, February 25, 2010 10:48 PM | Feedback (0)

MVVM: To Wrap or Not to Wrap? BLINQ and CLINQ to the Rescue! (Part 3)

In part 1, I asked the question “Do I expose the model directly, or do I wrap each item in its own view model?” We looked at two plausible options for handling this and saw some code examples of each. In part 2, I asked the question “Do I expose the model’s collections directly, or do I wrap each collection?” We saw the progression of code to implement this "brute-force". Then we quickly ran away screaming. This installment (part 3) asks "How do I cleanly and easily wrap the model’s collections with collections of ViewModels?" We'll take a...

posted @ Tuesday, February 09, 2010 10:45 PM | Feedback (8)

MVVM: To Wrap or Not to Wrap? Should ViewModels wrap collections too? (Part 2)

In my previous post, I asked the question “Do I expose the model directly, or do I wrap each item in its own view model?” We looked at two plausible options for handling this and saw some code examples of each. Now it’s time for a more interesting and challenging scenario: Do I expose the model’s collections directly, or do I wrap each collection? Let me paint this picture a bit so that we can see the scenario and the challenges. MVVM says that a ViewModel sits between the View (XAML) and the Model. The ViewModel (VM) exposes data from the model...

posted @ Tuesday, February 09, 2010 2:48 PM | Feedback (6)

MVVM: To Wrap or Not to Wrap? How much should the ViewModel wrap the Model? (Part 1)

The WPF community seems pretty happy with the MVVM pattern for WPF development. I can see why. It’s a great fit for WPF and its strong data-binding support. It provides a very nice layer for managing UI state, translating, formatting, and aggregating data. So let’s say that I adopt MVVM for my project. I think there are some scenarios that still need definition. One of these is “To Wrap or Not to Wrap?” Let me explain… MVVM says that a ViewModel sits between the View (XAML) and the Model. The ViewModel (VM) exposes data from the model plus additional view-specific details that...

posted @ Tuesday, February 09, 2010 11:11 AM | Feedback (12)

C# Snippets for Properties that support INotifyPropertyChanged

Since WPF likes INotifyPropertyChanged on bound objects, I looked for a snippet to help out. Matthias Shapiro had a good version for the interface implementation and a property declaration. I made a couple adjustments to the snippets based on personal preference (check if the value has changed before raising the event / remove the region from the property. Then added some property verification support based on the snippet sample from Philipp Sumi. The property verification uses reflection to check if the property exists. If not, it throws an exception. This function is marked with a Conditional attribute so that it...

posted @ Monday, February 01, 2010 3:08 PM | Feedback (9)

CSS Layout - I'm sold!

I picked up "Head First Web Site Design" to help me with the "design" portion of a new site. The author walks through a number of great topics, including information architecture, color, layout, and CSS. I have heard about using CSS for layout, rather than HTML tables, but had not fully investigated or used the approach. After walking through the book, I understand this approach better and understand the reasoning. It's really cool and quite amazing to see how powerful a CSS based layout can be. I'm used to the table based layout, but I think a CSS layout approach feels...

posted @ Monday, December 28, 2009 1:02 PM | Feedback (0)

Theme Forest and Graphic River are sweet!

Recently used Theme Forest and Graphic River for a new web site. I was very impressed with the number of site templates and graphics available for a really good price. I picked up a site template for $12 and some graphics for $6. The quality of the designs are way better than I can do myself and the prices are very reasonable.

posted @ Monday, December 28, 2009 12:38 PM | Feedback (0)

.NET SIG Presentation - AzMan

I recently gave a presentation at the Bennett Adelson .NET SIG in Cleveland. We covered the basics of Windows Authorization Manager, what's new, and walked through a non-trivial demo that showed a variety of ways to use the technology. Slides and demo code are available on the Past Events page of the Bennett Adelson web site. It's the AzMan presentation from Nov 10, 2009. I'd love to hear any feedback about your experiences with AzMan. Feel free to contact me if you have any trouble with the demos. Cheers!

posted @ Tuesday, November 10, 2009 12:00 AM | Feedback (0)

Keyboard Shortcut for Office Smart Tags

I finally spent the 60 seconds it took to find the keyboard shortcut for Smart Tags, like the paste options and auto format tags that show up in office. Ready for it...? Alt-Shift-F10 This will expand the smart tag so that you can use the keyboard (arrow, enter, esc) to pick the option. Here's the info from MS on the keyboard shortcuts.   One other tidbit... If you need to bring up the context menu, but your keyboard doesn't have the button for it, you can use Shift-F10.

posted @ Wednesday, June 17, 2009 1:20 PM | Feedback (0)

Many-Core explained the Pat Helland way

This morning, I listened to a couple Channel9 podcasts with Pat Helland where he discussed the Many-Core movement.  There has been a lot of talk about parallelism and many-core computing, but Pat helped to put this in context. Pat explained the issues around cpu power consumption, the slowing rate of frequency increases. The fact that chips used to draw around 8 watts but now consume 150 watts helps explain why energy consumption is a hot topic in the data-center world. Based on this historical context, it makes a lot of sense why we'd move toward a many-core architecture. Instead of one...

posted @ Tuesday, December 02, 2008 9:41 AM | Feedback (0)

VS T4 Templates - Working Well and Saving Time

In a previous post, I mentioned the T4 text template feature that is built in to Visual Studio. This past week, I used T4 templates on one of my projects and it turned out very well. I created the templates to help automate the creation of the classes in our DAL layer. The templates provided us with a couple of nice benefits: Saved time - reduced the time to create the DAL by 50 - 75%. Consistency - the classes are implemented in a consistent pattern, while...

posted @ Thursday, November 27, 2008 12:22 AM | Feedback (6)

V.Next of my career

My last day at InfoCision was Friday. It is strange leaving behind seven years of my life. I gained friendships with some great people. I learned a lot from the people, projects and positions along the way. I sincerely hope to keep these friendships for a long time to come. To my InfoCision colleagues... Thank you! I wish you all the best! Monday marks the start of v.next for my career. I'm starting with Bennett Adelson. I'm super excited about the position! I get to work with really smart people and use some of the latest technologies. I think...

posted @ Saturday, November 15, 2008 10:09 PM | Feedback (0)

WCF – Cannot have multiple base addresses

We recently had a need to support a distributed transaction across web service calls. The natural choice is WCF. We managed to get the transaction support working, but ran into another issue along the way. WCF uses a stricter addressing scheme than ASMX. It only supports one “binding” per sheme. So, you can only have one valid HTTP:// address for your service. This is not the case with IIS or ASMX services, where a web site can listen on multiple IPs via multiple DNS names. ASMX services automatically adjust by returning WSDL that is based on the address...

posted @ Friday, October 31, 2008 11:15 AM | Feedback (3)

Red-Gate SQL Prompt – Very nice!

Today I got tired of typing long SQL table names, so I figured I’d try Red-Gates’s SQL Prompt add-in for SQL Management Studio. I installed the trial version and in a matter of minutes got my first experience of “Intellisense” for SQL. One word: Awesome! The tool is really nice. It integrates very well into the environment, provides a ton of useful information, time saving features, and configuration options. The demo version also includes a feature that formats the SQL code. This is pretty nice too. It makes everything the correct case, does...

posted @ Tuesday, October 28, 2008 5:03 PM | Feedback (0)

PDC 2008 – Keynote – Day 1

I watched the PDC day 1 keynote today with my fellow coworkers. Below are my (unrefined) notes from the session. Ray Ozzie Why Cloud? Current solutions focused on internal apps Future solutions will assume more external facing solutions Users expect more social networking features embedded in solutions (ranking, reviews, etc) Operations teams and Dev teams are finding that they must work more closely together Some companies have spike / valley traffic patterns Companies need redundancy as apps move to...

posted @ Tuesday, October 28, 2008 3:06 PM | Feedback (0)

Event Driven Architecture (EDA) at PDC and in The Architect Journal

EDA is a special interest of mine and one of the first posts on my blog. It seems that it is a great way to stitch together the services that we create inside the enterprise. Otherwise, you end up with the same tightly-coupled spider web that you had before SOA. Recently, my enterprise architect forwarded a great article on Event Driven Architecture from The Architect Journal. The article does a great job of explaining the idea and explaining how it fits in an SOA ecosystem. Definitely worth a read! You can imagine my delight to see that Microsoft is releasing EDA capabilities...

posted @ Monday, October 27, 2008 10:06 PM | Feedback (0)

PDC 2008 – Get ready for the tidal wave of new stuff!

  Microsoft’s PDC conference started today. They’ve got a ton of great stuff coming out this year! While I cannot be there this year, I’ll soak up as much as I can… http://www.MicrosoftPDC.com/

posted @ Monday, October 27, 2008 2:16 PM | Feedback (0)

Great info on T4 Templates for VS

Oleg Sych has a great set of posts that show how to use the T4 Templating feature that is included in Visual Studio 2008. This is a great technology that makes it really easy to create code generation capabilities inside a project. He goes into the details, but it’s really simple to get started. Add a text file with a “.tt” extension. Add your template to the file. Add logic to the template in your language of choice (VB.NET / C#) Save the template...

posted @ Monday, October 20, 2008 12:38 PM | Feedback (1)

J.D. Meier’s “Insights … for work and life” – Awesome!

J.D. Meier has a ton of great information and advice for improving at work and in life. His “Effectiveness Post Roundup” post gives a nice list, linking to lots of great information. He has information on a variety of topics including: Communication Email Leadership Learning Management Productivity Project Management Teamwork...

posted @ Monday, October 20, 2008 11:34 AM | Feedback (0)

Fixing XP’s Windows Explorer Search for files “Containing Text”

I think I found something that fixes the problem with XP’s windows explorer search for cases where you are searching for text inside a file. You may have noticed in the past, that it doesn’t return results that you know it should return. The fix that seems to be working so far is referenced as method #2 in the MS Knowledge Base article KB309173. The article includes the following recommendation: Method 2 To configure Windows XP to search all files no matter what...

posted @ Monday, October 20, 2008 11:08 AM | Feedback (1)

Fiddler – Put a breakpoint in your network traffic…

I've been using Fiddler for a while and covered some of the basics in a previous post. I just learned that with Fiddler, you can put a breakpoint on network traffic! It’s “F5” for network packet capture! Basically, you launch Fiddler and tell it to stop once it’s received the request (F11 keyboard shortcut). Then you can look at this request and even change it. When you’re ready, you can tell Fiddler to send the request on to it’s ultimate destination. But it doesn’t stop there… You can either tell Fiddler to just continue, or you can tell it to stop again once...

posted @ Monday, October 06, 2008 4:42 PM | Feedback (1)

Finally! A tool to help with Kerberos delegation!

I ran across a useful utility that helps both in explaining and diagnosing Kerberos delegation setup. The utility is really nicely done. You just put it on your web server, and then browse to the page. The good stuff is green and the errors are in red. The great thing is that it has in-line explanations of everything and additional steps to help fix the problem! The utility is specifically targeted at showing whether delegation will work and explaining in detail why it might not. It also allows you to “add a backend” server to the...

posted @ Monday, October 06, 2008 4:42 PM | Feedback (0)

C# has the ?? operator, what about VB

A nice VB statement is IF(). It’s equivalent to the C# ?? operator. It works like this: Dim i as integer? = Nothing Console.WriteLine(IF(i, –1)) i = 3 Console.WriteLine(IF(i, –1)) The above will output: -1 3 The IF() statement evaluates the nullable variable. If it is not null, then it will return the value of the variable. Otherwise, it returns the value of the second parameter. The equivalent in C# would be: int? i = null; Console.WriteLine(i ?? -1); ...

posted @ Friday, October 03, 2008 4:41 PM | Feedback (0)

Nullable Booleans – Very interesting…

As I started looking at LINQ, I’m running into some interesting scenarios regarding nullable boolean values. We all know how SQL allows for a BIT to be 3 values: True, False or NULL. We also know that in SQL, handling NULLs in comparisons requires special attention. For the most part NULL does not equal NULL. The use of LINQ brings this concept and scenario up into the .NET programming world. Now I need to be careful about conditionals that include Nullable(Of Boolean). I won’t repeat all the information here, but please read the following articles that explain this...

posted @ Friday, October 03, 2008 4:40 PM | Feedback (0)

Use Fiddler to view traffic when running locally…

If you haven’t used Fiddler, you should check it out. It shows you the HTTP traffic that is flowing over the wire. This can be a huge help when diagnosing issues. One small challenge is using Fiddler to view traffic that stays on the local machine. By default, fiddler cannot see data sent to http://localhost/ or http://127.0.0.1/. This is because the OS doesn’t push this data through the normal networking pipeline. One workaround is to use the name of your machine in the URL. So, if you have a machine named “Machine1”, you could use a URL of...

posted @ Friday, October 03, 2008 4:40 PM | Feedback (0)

Top 10 LINQ Myths

Nice article listing the top 10 LINQ myths… http://www.albahari.com/nutshell/10linqmyths.aspx

posted @ Friday, October 03, 2008 4:39 PM | Feedback (0)

Model Driven Architecture with “Sculpture”

I just stumbled on a CodePlex project called Sculpture. It’s a Visual Studio add-in / package that allows users to create services and applications in a model-drive approach. Model Driven Architecture (MDA) has been a hot topic lately. You can see this in Microsoft’s feature set of VS 2010. They’re baking in many features to “design” systems visually and raise the level of abstraction. Sculpture is pretty new (currently in beta), but the way they’ve implemented it is pretty nice. It’s more than just a code-generator. It appears that you can re-generate the model down into your...

posted @ Wednesday, October 01, 2008 4:39 PM | Feedback (0)

Good article on ADO.NET Data Services from VS Mag

Visual Studio Magazine has a nice article that gives a good intro and 360-degree view of MS’s “cloud” data services offerings. These are now available for use via the VS 2008 / .NET 3.5 SP1 release. http://visualstudiomagazine.com/features/article.aspx?editorialsid=2469 There are a lot of individual, but related offerings coming from MS under the “… Data Services” umbrella. In general, they are MS’s cloud computing and REST based technologies. These technologies are common for public services on the web since they are simple to use and based on widely accepted standards. I’m not yet clear on how these will be used...

posted @ Wednesday, September 24, 2008 4:38 PM | Feedback (0)

Entity Framework FAQ

Great stuff: http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx

posted @ Tuesday, September 23, 2008 4:37 PM | Feedback (0)

“Real World” LINQ to SQL

I found a pretty nice webcast on LINQ to SQL from Teched. It's a 400 level session that goes into some of the challenges in creating "real world" applications with LINQ to SQL. http://www.microsoft.com/events/teched2008/webcasts/TLA402/#9 Tony discusses a few different "real world" scenarios: 1. Using LINQ to SQL with a distributed, service-based system. 2. Handling change tracking (what was updated / inserted / deleted) by the client code. 3. Concurrency 4. Injecting business logic 5. Using stored procs He does a very nice job of showing how things work and covers most of the topics in sufficient details to get the point across. He also...

posted @ Tuesday, September 23, 2008 4:37 PM | Feedback (1)

WCF Proxies - Don't use a "Using" block...

There's an issue with WCF proxies that is starting to get some (negative) attention. It has to do with the fact that WCF proxies can throw an exception when they are disposed. There are a number of posts on the net about this, so I won't go into details here. Microsoft has an article on this issue: http://msdn.microsoft.com/en-us/library/aa355056(VS.85).aspx Tony Seed has a good article that shows a nice way to fix this, including a code snippet. http://blog.tonysneed.com/?p=86

posted @ Tuesday, September 23, 2008 4:36 PM | Feedback (0)

I’m on Twitter…

I just signed up on Twitter. It looks kinda fun. http://twitter.com/nathanaw

posted @ Wednesday, September 17, 2008 4:33 PM | Feedback (0)

Viewstate – In Depth…

John Nastase sent me the following information on ViewState. I found it very helpful in understanding the inner workings. http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx The article is pretty in depth, but it explains things very well. Definitely worth a read. Thanks John!

posted @ Friday, September 05, 2008 4:33 PM | Feedback (0)

Share a Keyboard, Mouse and Clipboard without a KVM switch…

One of the “Desert Island” picks from a recent “This Week on Channel9” episode mentioned a pretty cool utility that lets you share a keyboard and mouse between two computers without using a KVM switch. It’s a software based solution that you run on the primary and any other computers that you’re sharing. You can share many many computers if you want. In my case, I have a laptop and a desktop. I wanted to have a single keyboard, but not have to worry about a kvm switch. The software is called Synergy. You can get it at...

posted @ Friday, September 05, 2008 4:31 PM | Feedback (0)

Web Gardening - 2x throughput increase via IIS configuration

As part of the load testing for an audio streaming solution, I’ve tested out Web Gardening. My candidate is a beefy quad-core Xenon based server. Background: The audio streaming services run under IIS. Their job is to locate an audio file and deliver it in an acceptable format to the user. Some of our audio is in a compressed wave format, but most is in a proprietary encoding. Our approach is to deliver this as a WMA format to the user, which requires two conversions. One from the proprietary format to PCM Wave format. Then we...

posted @ Wednesday, August 27, 2008 4:28 PM | Feedback (0)

Windows Live Writer

If you've been writing any blogs (or if you'd like to start), I highly recommend Windows Live Writer. I started using it after I got back from vacation. It makes it really easy to create and edit blogs. It has a spell checker, image support, nice formatting, and (best of all) a larger area for writing your post.  

posted @ Friday, August 15, 2008 4:23 PM | Feedback (0)

XML Comments!

I've started using the XML commenting feature in VS 2008. It's great!!! I knew that it was there, but I never realized that there was Intellisense support for writing the comments. I figured I have to remember a bunch of XML tags and write it all by hand. Not so. It' super easy to write the comments using the XML comments blocks! To get started just try it. All you have to do is type three apostrophes and VS will inject an XML comment block with a summary, remarks and sections for each of the parameters on the method. Then you just...

posted @ Friday, August 15, 2008 12:00 AM | Feedback (0)

Silverlight .NET SIG – Independence, OH

I attended the .NET SIG at the Microsoft offices in Independence last night. John Stockton presented Silverlight to the group. He did a very nice job. It was sort of an intro-level discussion of Silverlight with a focus on how Silverlight can consume and connect to various sources of data. Below are my notes from the session Backwards Compatibility Silverlight plugins are backwards compatible. Version 2 will run apps written against Silverlight version 1.1. ...

posted @ Wednesday, August 13, 2008 3:39 PM | Feedback (0)

VS 2008 SP1 – ASP.NET Dynamic Data

VS 2008 SP1 has many new features. One of these is ASP.NET Dynamic Data. Scott Hanselman has created a number of really good screencasts that show the basics of Dynamic Data. I watched most of these during lunch today and I am very impressed with the technology. They did some really nice work to make simple apps really easy to build. To quote the site: "ASP.NET Dynamic Data provides a framework that enables you to quickly build a functional data-driven application, based on a LINQ to SQL or Entity Framework data model. It also adds great...

posted @ Tuesday, August 12, 2008 3:35 PM | Feedback (0)

VS 2008 SP1 – ADO.NET Data Services

Here’s a good article that introduces the ADO.NET Data Services features that come with VS 2008 SP1. From what I understand, Data Services is an umbrella for a variety technologies. We’re seeing the first part of this now with SP1. The support includes some server side technologies for making REST based calls for CRUD operations on data. It also includes some client libraries that make the programming experience nicer. The client libraries include APIs for .NET, Silverlight, and AJAX. There is also support for making LINQ queries to an ADO.NET data service. The data services framework rides on top...

posted @ Tuesday, August 12, 2008 3:34 PM | Feedback (1)

Olympics & Silverlight

I’m a pretty huge fan of the Olympics. I don’t watch much TV, but when it’s time for the Olympics the TV is almost always on. This year, I’m really excited what NBC has done with the online coverage. They’re delivering live and on-demand coverage of a lot of the events. This is great because many events are on in the middle of the night. This year, I can watch yesterday’s events on demand at my convenience. For example, they made available the entire 6 hour footage of the men’s bicycling road race. (I haven’t watch all of that...

posted @ Monday, August 11, 2008 3:32 PM | Feedback (0)

RockScroll and the best software license ever...

I stumbled on a really nice tool for VS called RockScroll. It's a replacement scroll bar for .NET code files. It shows a preview of the entire file as the scroll bar. The install is simple and you can easily disable it via the VS Add-ins manager. One of the really cool features is the automatic "Find in page" feature. You just double click a word and it will show you all the places in the file where that word exists. You can quickly find and see all places where it exists via the scroll bar's preview...

posted @ Thursday, August 07, 2008 3:30 PM | Feedback (0)

List(of T) should not be exposed on a public interface...

I ran some code analysis on my audio streaming solution today and learned something new: There is a recommendation within the code analysis engine that looks for cases where the List(of T) type is exposed as a public property or on a public method of a class. The recommendation is to use something like System.Collections.ObjectModel.Collection(of T) instead. This seemed kind of strange to me, so I looked into it a bit. Here an article from the code analysis team blog that explains the rational: http://blogs.msdn.com/fxcop/archive/2006/04/27/585476.aspx I'm still looking into this a bit. There may be consequences...

posted @ Friday, June 27, 2008 3:23 PM | Feedback (0)

Krugle - A search engine for source code...

I just learned about a search engine called Krugle (http://www.krugle.org). It lets you search billions of lines of code in open source projects around the world. It's really a pretty neat thing that they've done. There are many times that we need to write some complex sort of code that someone else must have had to write too. Why not see if you can re-use it and save yourself the time. The engine is aware of source code structures, so you can select your language and then search for the keyword in certain locations like class names,...

posted @ Thursday, June 26, 2008 3:20 PM | Feedback (0)

Entity Framework - It's much more than just another O/R mapper

I listened to an Entity Framework podcast from Channel9's "Expert to Expert". Brian Beckman (a mathematician at MS) interviewed Sam Druker (GM of the Data Programmability group) about the design and philosophy of EF. It was a very interesting discussion and helped to position EF in comparison to the other O/R options out there. There were a couple key points that stood out to me: EF is not just an Object / Relational mapper in the classic sense of the word. It's scope is much more than just translating a .NET class into a SQL row. ...

posted @ Monday, June 09, 2008 3:20 PM | Feedback (0)

VB.NET is Case Sensitive when it comes to Web Services...

For the most part, VB.NET is not case sensitive. XML is case sensitive. As you work with web services (datatypes, method names, parameters, etc), please be aware that changing the case of a name is a breaking change.

posted @ Wednesday, June 04, 2008 3:15 PM | Feedback (0)

XML Namespaces - Simple idea, not so simple to work with

Rather than write this stuff myself, I've included a couple of good articles that get through the concepts quickly and easily. Why should you care about XML Namespaces? XML is everywhere, even if you don't work directly with it. As IMC moves more to web services, our systems are sending more and more XML over the wire. We're also starting to use it in the databases as a flexible data storage mechanism. In all of these cases, we must carefully design the namespaces so that we don't get collisions between two systems or two versions of the same...

posted @ Friday, May 23, 2008 4:44 PM | Feedback (0)

TFS Team Build: One area where TFS 2008 is not backward compatible...

For the most part, Microsoft did a very nice job of making TFS 2005 stuff work with TFS 2008 and vice-versa. There's one area that just isn't compatible: Team Build. This is a bit of a sticky issue. Let's take our planned approach here: Upgrade some people to VS 2008. They start writing apps with VS 2008. Let's say that they are even targeting the 2.0 framework. They add their stuff to the nightly build. The build breaks because TFS 2005 cannot build a solution from VS 2008. ...

posted @ Friday, May 23, 2008 3:11 PM | Feedback (0)

My first look at developing Silverlight 2.0 Beta 1

Last night, I got my first look at the Silverlight 2.0 (beta1) development experience. I downloaded and installed the Silverlight tools for VS 2008 and dove right in. Overall, I'm very impressed with Silverlight. I read through the first bit of the help files to learn the architecture and basic concepts. For the most part everything makes sense. There were a couple of things that caught me off guard. These aren't show stoppers by any means. Just things that I didn't expect: 1) Silverlight 2.0 does not support synchronous calls to web services. You can add a...

posted @ Friday, May 23, 2008 3:09 PM | Feedback (0)

Reference Types vs. Value Types

Remember the C++ pointer stuff that you learned back in school? Messy stuff! Thank goodness for .NET where we don't have to worry about pointers and references, right? Wrong! It's still important to understand what kind of object you're working with. In some cases, your variable is really a pointer. In other cases, the variable is the data. Can you Handle It? I dare you! First, let's start with a little test... Take a look at the following code snippets and see if you can figure out the answers. The Test Done Already! ...

posted @ Thursday, May 15, 2008 5:09 PM | Feedback (0)

Caching - Why, When and How

Caching is a very beneficial practice for improving application performance and efficiency. Conceptually, it is simple. However, there are a number of issues to take into account when caching data. I'd encourage you to read up on caching before you start using it though. As with all things, there are tradeoffs and challenges involved. So, be careful when and how you cache. Below is some info to get you started, but feel free to ask questions if you're doing caching for the first time. Caching is the practice of storing data in a location where it can be reused again...

posted @ Thursday, May 15, 2008 4:56 PM | Feedback (0)

Test your understanding of Reference Types vs. Value Types

Here's a little test to explore the way that value types behave differently than reference types when using .NET. Enjoy! 1) Passing an instance of a Class to a method ByVal. What's printed out:    a) 5    b) 15 Public Class MyNumberClass     Public Value As Integer End Class Module MainModule     Sub Main()         Sample1()     End Sub     Sub Sample1()         Dim oNumber As New MyNumberClass()         oNumber.Value = 5         Sample1_Add(oNumber)         Console.WriteLine(oNumber.Value)     End Sub     Sub Sample1_Add(ByVal num As MyNumberClass)         num.Value = num.Value + 10     End Sub End Module 2) Passing an instance of a Structure to a method ByVal. What's printed out:   ...

posted @ Thursday, May 15, 2008 12:00 AM | Feedback (2)

Guidance Packages for VS 2008

Guidance Packages are awesome, but they do have a way of driving me crazy sometimes. They have a new version of the Guidance Automation Extensions, which is basically the runtime or framework that plugs in to VS. The new version was updated to support VS 2005 and VS 2008. The documentation indicates that the installers for guidance packages are now supposed to prompt you for which version of VS to install into. Not. After searching and reading about 20 different articles, plus using Reflector on the GAX dlls, I finally figured out that you have to...

posted @ Tuesday, May 13, 2008 3:07 PM | Feedback (0)

For...Each loops can be nasty...

A couple weeks ago, my team was having issues with a new version of one of our web services. It seemed that it was using up all available TCP ports on the server, thereby causing a Denial of Service. We found the root cause of the issue... A For..Each loop! So, For..Each loops aren't bad. The problem was what we did inside the loop. We were looping over a set of records and then reaching out to another web service. This resulted in thousands of individual web service calls back to the same web farm. The solution:...

posted @ Wednesday, March 26, 2008 3:06 PM | Feedback (0)

WCF + WF with .NET 3.5 & VS 2008 - Much better!

I watched a webcast on how to use the WCF/WF integration that comes with .NET 3.5 and VS2008. It looks like they've added some features that make it very easy and very powerful to use WCF with WF workflows. Here are the things that caught my attention: WCF Service Host VS 2008 comes with a built in WCF Service Host. It acts similar to the Cassini web server that VS 2005 uses for asp.net web sites. The cool thing is that you don't need to create a host project to host the WCF service. Just the WCF...

posted @ Friday, February 22, 2008 2:02 PM | Feedback (1)

LINQ is Awesome! (In theory anyway...)

Last night, I finally dove in and read up on LINQ. Amazing stuff! Since I haven't actually written anything with it, everything I know is just theory and second-hand. That said, LINQ looks really cool. It's another example of Microsoft making a complex problem into a simple solution. I love how Microsoft looks at a problem space and says: "I know you say you want ... but here's a solution that addresses your real needs." I read a couple of things last night that helped me a lot. First was a Channel9 video with Anders...

posted @ Friday, February 15, 2008 1:59 PM | Feedback (0)

Aha! I finally understand XAML!

In researching MSE's policy support, I had to do some reading on XAML. It finally makes sense. So here's my 10,000 foot view of XAML: XAML (Extensible Application Markup Language) is an XML grammar for instantiating a tree of objects, setting their properties, and stitching them together. Pretty simple, but pretty powerful idea! I can use XML to declare what objects to create. Then the same XML has the values to stuff into the properties and the logic to hook on object to another object. The XamlReader class in the .NET 3.0 framework reads the XML in and...

posted @ Thursday, February 07, 2008 1:59 PM | Feedback (3)

MSE's extensibility...

At the ArcReady seminar, Chris Madrid discussed the MSE's support for custom policies. This is the extensibility point in MSE for adding your own WCF behaviors into the MSE's runtime. He showed some simple examples like turning off the metadata output of a service. The cool thing is that you can inject any behavior you want into the engine. Some ideas that he mentioned: Publishing info to BizTalk's BAM service so that we can analyze the traffic going in and out of the web services. Logging messages to some sort of...

posted @ Thursday, February 07, 2008 1:58 PM | Feedback (0)

ArcReady Seminar - Service Lifecycle and the MS Service Engine

This morning I went to an ArcReady seminar at the MS campus in Independence. Chris Madris, from MS Consulting Service, spoke on SOA Lifecycle Management. Great Stuff!!! Chris talked about best practices for creating and operating an SOA environment. Then he demo'd the MS Service Engine that MS Consulting Services has created to "Virtualize" services. Layers... Chris presented the idea that there are three layers of services: Process Layer, Service Layer, and Integration Layer. The Infrastructure Layer sits on the bottom and exposes systems to the enterprise. These might be wrappers around legacy...

posted @ Tuesday, February 05, 2008 1:57 PM | Feedback (0)

Spring.NET - My first project...

Yesterday, I created my first UI using the Spring.NET framework. I have to say that I am very impressed! The features I used were - Dependency injection - Model-view-controller support - Two way databinding I have a couple pages done and so far they are turning out to be conceptually simple and clean. The framework strikes the right balance between being too intrusive vs not helpful enough. I am able to use the features that I want, without having to "drink all the cool-aid" at once. The two way databinding is really nice because it decouples the UI stuff, the databinding, and the UI business...

posted @ Wednesday, January 30, 2008 12:00 AM | Feedback (0)

Enterprise Library - version 4...

It looks like MS is working on Enterprise Library version 4.0. From what I can tell, version 4 should be very cool. Check out the backlog for version 4. (Yes I did say backlog... They use agile methods in the Patterns and Practices group.)

posted @ Wednesday, January 30, 2008 12:00 AM | Feedback (0)

Being in the user's shoes...

This past weekend was my son's cub scout pinewood derby race. I was point person on the committee that organized the event. My main task happened to be running the score board which was written in Excel. I found it quite interesting to be in a position where I was very dependent on the computer and the excel based "application" that we used to run the scores. The thing that surprised me was how nervous I was about the score board working right. The race was a points race with a specially organized set of pairings that rotated the races in such...

posted @ Sunday, January 27, 2008 12:00 AM | Feedback (0)

Model-View-Controller for the web

Over the past couple days, I've been exploring some of the popular open source application frameworks out there. The ones that caught my attention were Spring.NET, MonoRail, and ASP.NET MVC.   All of these offer a nice way to implement web applications using the Model-View-Controller pattern. This pattern helps to separate the UI into it's logical pieces. Once implemented, it becomes much simpler to make powerful UIs with multiple views into the same information.   For an example of MVC, think of MS Word or MS Outlook. They can show you many different "views" of the same data. All of the views...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (0)

Aspect Oriented Programming (AOP)

Aspect Oriented Programming (AOP) is a term I've stumbled across a couple times before. My 2-second understanding of it was basically that you use attributes in your code to define how the code should behave. These attributes could do things like wrap the method in a transaction or log information about the method call.   So what's the big deal about attributes? We already do that all over the place in .NET as we write web services, etc.   Well, I stumbled on a framework called Spring.NET and read up on it. For some background... Spring.NET is a "spiritual port" of the widely used...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (0)

Inversion of Control and Dependency Injection

As mentioned in my post on AOP, I've been learning more about Inversion of Control (IoC) and Dependencey Injection (DI). I'll explain my take on these a bit more in this post.   IOC and DI have been gaining ground lately in a number of areas. Microsoft built the widely accepted Enterprise Library and the Composite UI Application block on top of an IoC library that they call Object Builder. They chose this design because it gives them a very powerful way to manage a large number of dependencies in these highly-integrated frameworks.   For example, in Enterprise Library, the Exception block...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (0)

Microsoft releases free service virtualization and governance tool

Awesome!!!   Microsoft has released a tool that they developed inside their consulting division. They created the tool to help their customers and now they are starting to make it more widely available.   The Microsoft Services Engine is a runtime that helps manage, version and govern a portfolio of SOA services.   The version they released is version 6.2, which indicates that it's already been through the paces of real-world use. It comes with decent documentation, a management UI, a universal service tester, and the runtime that hosts the virtual services.   It's built on WCF and has a deep understanding of how WCF works. This...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (0)

Updated Guidance Packages - Very cool!

Just a quick note here, but MS has released updates to some of their guidance packages. The updates look very compelling.   It also sounds like the guidance package framework (GAX and GAT) are going to become an integrated part of the next verison of Visual Studio. This is also very good news.   Most of these are hosted on CodePlex, with supporting pages on MSDN.   Web Service Software Factory (Modeling Edition) Very cool! They used the DSL (Domain Specific Language) toolkit to create a visual designer for creating web services. It looks a little like the class designer in VS 2005.    They also stripped out the data access stuff. This...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (0)

ESB vs. Event Driven Architecture (EDA)

I've learned about a new design pattern that is conceptually similar to an ESB. It's called an Event Driven Architecture or EDA. I like this term because it describes the pattern that I've been trying to implement here at IMC via our Service Bus implementations. I still think that an ESB is useful, but the industry seems to be converging on the concept that an ESB is something sort of like BizTalk with it's transformation and orchestration capabilities. EDA can be implemented on top of an ESB of this definition, but it does not require that much power to work right. Microsoft actually...

posted @ Thursday, January 24, 2008 12:00 AM | Feedback (1)

Welcome!

Thanks for stopping by my blog! Glad you're here! I hope to share my experiences, lessons, and ideas on the important parts of my life... Family Software Development, Architecture and Engineering Cub Scouts Cycling

posted @ Wednesday, January 23, 2008 12:00 AM | Feedback (1)