December 2008


MEF is the Managed Extensibility Framework, which is a project out on CodePlex. The aim of the project is to allow greater reuse of applications and components. Microsoft has said that they will be using it in the next rev of Visual Studio – so there’s some buy-in there. :)

In dashCommerce we allow you to drop in your own providers for Tax, Shipping, and Payment. There are others coming, but one thing that seems to be tripping people up is how, exactly to pull that off. Now, I think it’s pretty darn easy, but I built it, so it makes perfect sense. ;) In addition, people are doing some pretty amazing things with dashCommerce and the application is growing – quickly. And there is a ton of room for additional functionality and flexibility.

With that in mind I started playing with MEF to see what the basic facilities were. And I had something in mind that I wanted to test right off the bat – dropping assemblies into the bin directory and see if they would auto-magically appear for use by the application. I built a windows service a few years back that allowed you to do just that – it was pretty slick, but I never went any further with it. Well, MEF allows us to make the shift from statically compiled applications to dynamically composed applications. There is a lot of power there. A lot.

So, with my minimal goals in mind, I set out to create a simple Cashier application that would try to charge something (actually, it doesn’t charge anything, but it says it does). On the first pass through, there are no classes that implement IPayment so it looks like this:

 mef-1.gif

If I then browse the solution and drop the Payment assembly into the Cashier\bin\Debug directory and press the space bar, I will see this:

mef-2.gif

You can see that without stopping and restarting the application, it has recognized that I have dropped in an assembly that has a particular type of export in it:

  [Export(typeof(IPayment))]

I can then browse to the Authorize assembly and drop it into the same location and press the space bar once again and I see this:

mef-3.gif

Now it recognizes that it has two classes that implement IPayment and it is exercising the Charge() method on each of them. Now, if we couple this with dropping the configuration controls into a specific location, we will get rid of the registration process that currently has to happen in dashCommerce and we will be on our merry way to composing dashCommerce in a highly flexible way! Very sweet!

[UPDATE:]

I did try to upload the sample solution, but WordPress doesn’t allow the uploading of .zip files. So, I had to do a little thing to get it to work. You can get it here.

DotNetKicks Image

My friend Corey Haines recently embarked on an interesting experience. He has spent the last three weeks traveling around the central midwest pair programming with people that would put him up for a few days. I’ve been watching the videos and the twitter traffic on the experience with real admiration. This apparently has caught the eye of quite a few folks as there is a write up on InfoQ about Corey and his experiences.

This really captures the essence of the best part of programming – programming with others. And, I think it highlights some of the disappointment I’ve had recently with my own programming experiences.

When I started programming, I had just come from about 6 years of traveling around. The bulk of 2 years I spent traveling around, doing road trips and working in Yellowstone National Park. That was followed by 4 years in the U.S. Navy on the USS Normandy – a guided missile cruiser. At the time, the Normandy was considered one the best CG’s on the east coast, which means we got to spend a lot of time at sea and traveling. After the navy, I was finishing my degree at a small university here in Cleveland – John Carroll University. I was pursuing a business degree with a concentration in business technology. That resulted in me literally falling into programming. I was taking a course in database design which dovetailed into some web work that I wanted to do. My interest in the topic was noticed by one of my professors and when he took on some side work, he asked me if I would like to do the project with him. Looking back on the following six months, I realize now that we spent a good portion of those six months pair programming. It started with me watching over his shoulder and trying to keep up with what he was doing. Over time, I started to get it and at the end of the six months, we were swapping turns at the keyboard, while the other focused on the task at hand.

I had no idea that what we were doing was so “cutting edge”. :) It was a practical example of him trying to teach me so that I could take on the load and earn my portion of the contract.

I’ve also been trying to think about how I want to go about creating the next version of dashCommerce, and I think I would like to take some inspiration from Corey and pair program as much as I reasonably can. I’d also like to capture as much of that as possible in some screencasts and put them up for review by others.

So, who will I pair program with? Well, hopefully, I’ll be able to convince some of the core members of dashCommerce to do this with me, but I also want to do it with members of the community that have an interest in trying out pair programming that may not have an opportunity to do it in their everyday life. So, if this sounds like something you would be interested in, please drop a comment here and I’ll set something up with you. I figure we can do it over Skype and with Microsoft SharedView. I’ve got Camtasia installed to capture the screen cast stuff and I figure we can do 1 or 2 hour sessions and then distill out of that some smaller screen casts that capture the best moments of the experience.

My plan is to start the next version of dashCommerce the 2nd or 3rd week of January, so if you are interested, please drop me a note.

For those of you out there looking to free yourself from The Cubicle Nation, you should definitely check out the Microsoft BizSpark program. This is an enormous package for basement startups and I wish, oh do I wish, something like this would have been available years ago. Well done Microsoft, you definitely go this one right!

What do you get? Check it . . .

Microsoft® BizSpark™ is a global program designed to help accelerate the success of early stage startups by providing key resources when they need it the most:

  • Software. Receive fast and easy access to current full-featured Microsoft development tools, platform technologies, and production licenses of server products for immediate use in developing and bringing to market innovative and interoperable solutions. There is no upfront cost to enroll.
  • Support. Get connected to Network Partners around the world — incubators, investors, advisors, government agencies and hosters — that are equally involved and vested in software-fueled innovation and entrepreneurship who will provide a wide range of support resources.
  • Visibility. Achieve global visibility to an audience of potential investors, clients and partners
    As a Microsoft BizSpark member, you’ll be tapping into a rich, vibrant ecosystem of peers, partners and support resources around the globe, helping you grow and succeed. Microsoft BizSpark is the quickest way to get your Startup fired up.

There are some things that I WANT desperately to get right before we start on dC v.Next and one of those is documentation. I am talking about conceptual, code examples and and API documentation. The API documentation is pretty well taken care of with some xml comments and some discipline, but the code examples and conceptual stuff is not so easy to get in there as part of the development process.

Ideally, the build process will spit out the documentation – all of it into one help package. The guys as Mindscape have briefly documented their documentation process, which I may use, but I was hoping to avoid the Ruby stuff.

I found the DocProject project, but it’s still a very manual process.

Does anyone out there have any good processes in place to take care of this? Are there any OSS or commercial applications that make this easy?

I stumbled on this tool and the accompanying utility the other day and thought is particularly handy. The IconHandler will pull from the OS the appropriate icon for a file given it’s extension. In the case of servers that may not have the associated software and icons installed, you can use the IconGen.exe utility to pull them from your development machine (which is usually packed with software :) ) and use them in the application. Check out this blog post to learn more:

http://mvolo.com/blogs/serverside/archive/2008/04/27/IconHandler-2.0-File-icons-in-ASP.NET-applications.aspx

I wanted to mention that there are some new tools and utilities over at dashCommerce.com. There is the new YocuTeem Per Order Shipping Charge provider written by forum member YocuTeem. I know he’s got a bunch of other stuff cooking, so keep your eye on YocuTeem.

YocuTeem Per Order Shipping Charge Provider

This shipping provider, brought to you by dashCommerce forum member YocuTeem, extends the shipping provider model of dashCommerce by allowing your dashCommerce website to charge a flat rate per order for shipping.  This shipping provider allows you to setup many different shipping options and charge one flat rate for shipping for your orders.  The end user selects the shipping option during checkout.  For example, the following two shipping options are setup by default when you install this shipping provider:  USPS Domestic ($5.00) and USPS International ($5.00).  
The shipping provider is easily configured via the Shipping Providers section of the dashCommerce admin website.

Also, there is a new category of products called Utilities. It is here that you will find the Jumpin Pages Export Tool.

Jumpin Pages Export Tools

This utility brought to you by Jumpin Pages LLC, allows you to export your inventory into Microsoft Excel exports for eBay File Exchange, Google Base (gBase), Shopping.com and Yahoo Shopping formats. 
You will be able to take the Google Base and Shopping.com files and immediately turn around and upload them into their systems.  The eBay and Yahoo files will need minor additional information, but will quickly get you listed.  There are links to the above respective provider’s signup pages for quick reference.
Also included are the reference files for each of the above exports so that you can add other columns that may not be as common.
This export utility can be installed in about 15 minutes by following the detailed installation instructions that are included in the package.

This is probably the most exciting part of running dashCommerce for me. I get to watch people take dashCommerce and build on top of it, beside it, and in the process, make the product better by offering very reasonably priced functionality. Good stuff!

music note While writing this, I was listening to "Lullaby" by The Cure

DotNetKicks Image

For an small ISV, the trouble you frequently encounter is managing all of the systems, environments, and tools you need to run your business.

One of the fundamental things is source control. I have always been a bit of a source control nut – openly scoffing at people that have asked me to “just develop on the server”. It’s my hangup – I know it. I knew it when they openly scoffed at me in return. :)

But when I started developing software, outside of the corporate environment, I knew this was one of the first things I had to do, and I didn’t feel like wrestling with server upgrades and all the luggage that goes with it. So, I decided to outsource my source control. Some may consider this heresy – hosting my source with a third party, but I figure they have better things to do than sniff around my code trying to figure out if it is any good. :) Well, that, and I have the source for my flux capacitor in my safe deposit box.

I have been using the folks at svnrepository for about two years now I think and I have been really happy with them. Don’t be put off by there minimalist web site – there support has been quite good – the once or twice I have had to ask a question. I wrote a post about this a while back, and this is completely unsolicited – I just like to mention a company I think is doing a nice job and is well worth the money I spend with them.

music note While writing this, I was listening to "The Sun Does Rise" by Jah Wobble’s Invaders of the hearte

DotNetKicks Image

I’ve been thinking about the dashCommerce security model – or lack thereof. :) Sure there is standard security, but what I want to be able to do is identify certain course grained operations and apply an authorization rule to it. That rule can then be configured and assigned to a role during application configuration and then modified at runtime as well.

For instance, maybe I have a “Create Product” authorization rule. That rule may only be configured for the Administrator role by default. But suppose there is a situation where I would like my vendors to be able to add product’s as well. I can see all sorts of situations where I would like to add additional rules to the application and assign these authorizations to them at runtime.

Also, considering the application is highly extensible, there are situations where I may drop in a new assembly and I would want any of the course grained authorization operations to automagically appear in my admin UI as authorizations to assign.

Sounds like something someone out there should have solved by now, but the only thing I see that is close to it is the Security Application Block in the Enterprise Library and that requires a code check. I’d rather see something like an attribute or something similar since dropping in an assembly, we’ll have to interrogate it dynamically for it’s operations and their respective authorization demands.

Is there anything out there that does this? Any guidance from anybody on do’s, don’ts and avoids?

music note While writing this, I was listening to "Panther" by Ultramarine

DotNetKicks Image

I use the Database Publishing Tool a lot. For some reason the version in Visual Studio didn’t work as well for me, so I have stuck with the free standing version of it. Not sure if there is a version that works with Sql Server 2008 yet, but this one works well for 2000 and 2005.

The problem you may encounter, as I do, is that the resultant script is waaaaaay to large to load into the Sql Server Management Studio. So, once you script out the database, then you can use sqlcmd.exe to run the resultant script on an existing database.

Your command line will look something like this:

C:\>sqlcmd -S YOUR_SQL_SERVER -U USER -P PASSWORD -d DATABASE -i "the_scriptpath"

And here it is in action:

sqlcmd 

music note While writing this, I was listening to "Ancodia" by 808 State

DotNetKicks Image

I have a lot of experience with NUnit, so it is very familiar to me. I did some work with MbUnit a while back and I liked some of the features of it. But, I know there are a bunch more out there now and I am looking for some feedback on what unit testing frameworks you like and, most importantly, why?

music note While writing this, I was listening to "Computer Blue" by Prince

DotNetKicks Image

Next Page »