# Friday, 23 November 2007

I had a problem today where a file exported from a system was showing up correctly in my text editor but whenever I tried to re-import it elsewhere my special characters where messed up; ÆØÅ showed up as garbled characters.

Of course the reason for this is the fact that the export sets an old code page on the file which isn't recognized by the receiving system so I simply had to change the code page of the file.

My instinct was to go with UltraEdit but I didn't have a license around so I thought that Visual Studio probably would get the job done for me and it did but it isn't too obvious how to do it; not that UltraEdit is intuitive in this area either :)

  • Open the file in Visual Studio.
  • From the file menu select Advanced Save Options
  • Select the code page

Visual-Studio-Advanced-Save-OptionsVisual-Studio-Advanced-Save-Options-Dialog

posted on Friday, 23 November 2007 11:32:44 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Commerce-Server-2007-Logo A while back a friend of mine posted a comment here asking me to describe what it's like developing with Commerce Server 2007. Initially I wanted to reply to him in comments but thinking more on it I really wanted to provide a different and real perspective on how Commerce Server is to work with as a product, a perspective in which I want to dig a deeper than the usual how-to and tutorials you see on the various Commerce Server blogs; mine included.

Check out part 1 entitled Secure By Default.

Three-Way Data Access

Commerce Server provides a lot of functionality out of the box; in fact it provides not one, not two, but three disparate data access schemes. Talk about getting your money's worth :) What this translates to is two things: Blazingly fast performance and a high bar of entry for developers.

Basically each subsystem in Commerce Server comes with its own data access system which means that you as a developer will need to learn and master them all to be able to leverage the features provided by the product. There are some general traits to the various data access model: You won't have to do much SQL, if any.

The Profile system is our general purpose data access system that we use whenever we have a custom piece of data we need to store; user profiles, addresses, cities, etc.. You can think of the Profile system as half of an ORM, it will help you get your data into your application in a nice fashion without you having to do SQL which is nice but it doesn't provide the last part of an ORM, the O, the part that actually turns the data in objects. You could call the Profile system an RM because what it provides you a general purpose name value collection that you can build on top of. When everything is set up the profile system is quite nice to work with, sure the API is a bit primitive compared to a full fledged ORM but it certainly gets the job done and a couple of nice abstractions on top will get you a nice domain model to work with.

The Order- and Catalog systems are a different story in that they are very specific in their purpose; they only deal with specific domain objects: Order- and catalog objects.

I would point to the Catalog system as the very best part of Commerce Server, it feels complete and very well done, both feature-wise and data access-wise. There are no nasty XML files, no having to map multiple levels of abstractions before getting the job done, it all works and works beautifully. The Schema Manager tool is to Commerce Server Catalog system what Enterprise Manager was to SQL Server 2000: Your one stop place to setup schema for your database. Everything is handled in a graphical manner which is translated to SQL statements, procs, and physical tables. The Catalog system is set up for performance which is clear if you go ahead and poke around the database, tables are denormalized, physical objects are created for new catalogs, and so forth. Interestingly you can actually learn a lot from the performance database design by going through the various databases of Commerce Server.

Finally we've got the Order system where we have the third and final data access system and also the newest one in our happy little family. CS 2002 introduced XML mapping files to map orders, lines, payments to actual objects. In that respect we are actually dealing with a full ORM here, only it handles orders and various associated object but nothing else. You'll have to get your hands dirty with multiple XML files and you'll have to do manual updates to the database to get everything going. You won't however have to do anything to actually use the subsystem that's nice squirreled away in the API.

It's interesting to note that across all the data access schemes Commerce Server actually contains some very powerful APIs, if only they were combines and unified to provide the full flexibility to all the subsystems. As a developer you'll have to wrap you head around all the models; on the upshot of this the individual models are not that complicated to work with so it's not exactly a Herculean effort you need to put into learning the APIs: It's mostly a matter of knowing where to look. There are good reasons for the subsystems not being unified but I'd really like a single architect at Cactus to sit down and consider what needs to be done to leverage either a preexisting ORM or to unify the functionality found in the disparate DALs.

Developing with Microsoft Commerce Server 2007 Part 3: Testability

posted on Friday, 23 November 2007 07:00:08 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, 22 November 2007

visualstudio_logo I've often wondered how life as an add-in developer for Visual Studio is like. On one hand you have the power to create tools and utilities which will benefit you greatly in your everyday life and you get the added benefit of geek-cred if you do your job really well.

On the other hand though we've got Microsoft who for any given release of a product can annihilate your entire market simple as that. In the same stroke they create markets simply by making stupid mistakes so it's really a double edge sword when you're working in semi-competition with Microsoft.

I think the newly released version of Visual Studio 2008, ah 2005 I hardly knew you, is a shining example of that however small the example is.

TestDriven.NET an add-in which has proven very useful to me, particularly for a single function: Run Test in Local Scope. Basically it allows me to execute the test I'm currently in with a shortcut and you know that I'm all about the shortcut driven development :)

Visual Studio 2008 introduces unit testing features in the professional version for the first time ever and with it a nice addition which does exactly what I've used TestDriven.NET for in the past: Run Test in Local Scope. It's even bound to the same shortcut that I chose myself when I configured TestDriven.NET the very first time. Just go CTRL + R + T and your test will execute. W

With a single stroke of genius Microsoft has taken away my need to install a third party add-in in Visual Studio 2008 by providing me with exactly what I need out of the box. Of course the feature only works with MSTest which will be a problem for all you xUnit users out there but we've run with MSTest for a while now making it a perfect fit.

MSTest-Run-Tests-In-Local-Scope

Oh yeah - Microsoft released Visual Studio 2008 this week :)

posted on Thursday, 22 November 2007 08:33:30 (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback
# Wednesday, 21 November 2007

Commerce-Server-2007-Logo A while back a friend of mine posted a comment here asking me to describe what it's like developing with Commerce Server 2007. Initially I wanted to reply to him in comments but thinking more on it I really wanted to provide a different and real perspective on how Commerce Server is to work with as a product, a perspective in which I want to dig a deeper than the usual how-to and tutorials you see on the various Commerce Server blogs; mine included.

Now I started this out with the intent of covering everything in a single post but as that post got longer and longer I decided to split it up into multiple parts. So here's the first installment with a couple more to come soon.

Secure By Default

The first thing you'll come to realize in the first couple of hours working with CS is that security is a big deal in this release; both a blessing and a curse. A blessing in the sense that the security system provided out of the box provides rich possibilities for securing the various subsystems of Commerce Server. If setup properly all components are protected by multiple layers of security and you even have the possibility to go one step further than that by leveraging business data security. Basically the last layer of security allows you to specify what data users or roles can access, not only that but you can go down to operation level and specify which operations are available to particular groups of users. While this sounds like role-based security it's not, this is much richer than that and is more akin to code access security only with a business focus rather than a technical focus.

I started out by stating that the rich security features are both a blessing and a curse, so how can that be the case with all of the above? The fact of the matter is that with security comes complexity, imagine a setup with multiple web sites running in IIS each with its own app pool of credentials, this goes all the way to the database where the individual services have very specific roles assigned to them. Debugging an error in a setup like that is very difficult and this is some of the more bland stuff you'll encounter :)

Commerce Server leverages a lot of platform technology, one that comes to mind immediately is Distributed Transaction Manager the very same used by System.Transaction in .NET Framework 2.0. Basically MSDTC is great when it's working, when it's not you'll really come to loathe it. I've been through numerous debugging sessions where MSDTC either wasn't running on all machines, it couldn't do reverse name lookups over the network, firewalls were blocking ports, etc.. As I said it's a pain when it's not running.

What this is all boils down to is that not only do you need to know Commerce Server as a product; you'll also need to know the basics of the Windows platform. This probably seems straightforward, if it does all the more power to you, but with more and more abstraction levels on top of the metal people do have a tendency to forget the underlying platform.

Developing with Microsoft Commerce Server 2007 Part 2: Three-way Data Access

posted on Wednesday, 21 November 2007 21:42:04 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, 15 November 2007

anug_logo_200x85 Jacob initiated a Facebook group for ANUG a couple of weeks back. An initiative of which I scoffed initially but I've come to realize my mistake after I took another look at Facebook.

My initial reaction was that I didn't want the hassle of maintaining another social network but I have to admit that Facebook brings a lot of interesting stuff to the table especially for a group like ours.

We run everything with volunteers, presenters, "infrastructure", places to hold the meetings, everything so naturally a site that offers everything we need to keep track of members and announce our events in a more structured manner is a very welcome addition to our toolbox.

As a result we're messing around with the group, getting people signed up, and we've created a couple of events already so check it out and please let me know what you think about it. Other than giving us some nice opportunities for the events Facebook brings support for uploading pictures to the group page, creating discussions, and posting comments.

Check out Aarhus .NET User Group Facebook Group

And why not join the ANUG LinkedIn group while you're at it to bolster your professional network?

BTW we've made really easy to remember URLS for Facebook and LinkedIn. Just go ANUG.dk/Facebook or ANUG.dk/LinkedIn, there's really no excuse not to spread the word ;)

Oh yeah, you can check out my personal profile as well if you can stand it :)

posted on Thursday, 15 November 2007 21:53:55 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, 08 November 2007

firefox-logo Did you know that you can bring your Firefox settings with you to other machines or reuse them if you reinstall your machine? I went digging because I was sick and tired of configuring Firefox time and again whenever I reinstalled Windows. It became even worse when I started using more and more plugins.

Luckily it turns out that Firefox has very nice facilities for backing up your settings and even bringing them to other machines. These facilities are not however readily available, in other words you need to know where to look.

Firefox has the notion of profiles. A profile stores everything you add or change in Firefox: Extensions, settings, URL history, everything. To back up your profile in Windows XP you need to go to:

c:\Documents and Settings\<Your Login>\Application Data\Mozilla\Firefox\Profiles\<arbitrary numbers>.profile

For Windows Vista you'll find the profile in:

c:\Users\<Your Login>\AppData\Roaming\Mozilla\Firefox\Profiles\<arbitrary numbers>.profile

Everything is in there, copy it to a safe location. Personally I store my Firefox profile on a separate drive along with my documents and various other stuff. When you need to activate your profile in Firefox you need to run Firefox with the -ProfileManager parameter:

Firefox.exe -ProfileManager

Firefox-ProfileManager

That will bring up the profile manager on which you click Create Profile where you can specify a path for your new profile.

FireFox-ProfileManager-Create-Profile

With this done you now have your profile ready to go and you can preserve it from one install to the next or bring it to a new computer. Combine this with FolderShare and you're effectively syncing your Firefox across multi computer automatically.

posted on Thursday, 08 November 2007 21:10:07 (Romance Standard Time, UTC+01:00)  #    Comments [1] Trackback
# Wednesday, 07 November 2007

It's not quite Friday yet but what the hell... Here's Achmed the Dead Terrorist:

Thanks to Anders for passing this one along.

posted on Wednesday, 07 November 2007 19:41:24 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

anug_logo_200x85 For the November meeting in Aarhus .NET Usergroup we're changing gears a little bit in that we're focusing on the inexperienced developer who wants to know how to go about creating .NET applications in a correct and maintainable fashion. At the meeting you'll see how to implement a blog engine in ASP.NET using various out of box capabilities of the platform.

We've been playing around with the time for the meeting but have finally settled on 18:00. We might entertain the idea of starting even earlier but for now it's 18:00.

Please note that there are two Scanvaegts in Aarhus; the Scanvaegt you need to go to is the one called Scanvaegt International and NOT Scanvaegt Nordic.

Please leave a comment to sign up

Practical Information

The meeting will be held:

Wednesday 28/11 18:00

at:

Scanvaegt International A/S

P. O. Pedersens Vej 18

8200 Århus N

Map

Agenda

Usergroup News

As always we'll update you on the stuff that's going on with the usergroup. This time around we'll focus on our Geek Christmas Dinner and the Code Camp specifically.

Professional .NET for Beginners, Brian Holmgård Kristensen, Vertica A/S

A taste of implementing an n-tier blog engine application in ASP.NET. The presentation will act as a brief introduction to the contents of the Code Camp coming in March 2008. Brian will during the presentation build a simple ASP.NET application from ground up utilizing the capabilities found in ASP.NET 2.0 with focus on good object oriented principles and architectural ideas should as the n-tier model.

In his whirlwind tour of ASP.NET and friends he'll dive into the various tools needed to get the job done such as Visual Studio 2005, SQL Server Express 2005, ASP.NET Master pages, ASP.NET Themes.

For specific topics and questions you'd like covered you can get in touch with Brian and he'll try and work it into his presentation.

Please leave a comment to sign up for this meeting

Break

Tour de Scanvaegt

As always we'll take some time to get some information from our gratious hosts: This time around Henrik Kristensen will tell us about Scanvaegt as a company and some of the challenges they're facing in the everyday life. Henrik is the cheif architect at Scanvaegt International so expect some good technical content from him :)

Open Forum

We'll close the evening off with open forum where you get to ask your questions or pose topics for discussion. Got something on your mind that you'd like us to discuss please bring it up. You're sure to get an opinion on the matter.

Please leave a comment to sign up

posted on Wednesday, 07 November 2007 16:32:03 (Romance Standard Time, UTC+01:00)  #    Comments [17] Trackback
# Monday, 05 November 2007

Just a quick note to say that my colleague Brian is attending TechEd Barcelona 2007 and is blogging as he goes. He's getting ready for the keynote as I write this so be sure to head on over to his blog if you're interested in the stuff going on at this year's conference.

IMG_1386IMG_1388 

I'm very envious that I couldn't go this year too :)

posted on Monday, 05 November 2007 13:29:02 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, 29 October 2007

My favorite part of the usergroup is probably the social aspects. To provide further support for this we decided to throw a geek Christmas dinner in December. We've already booked a table at Bryggeriet in Aarhus for fifteen people, but we can probably extend the number if we get a lot of interest but be sure to sign up now to secure a place.

The Geek Christmas Dinner is scheduled for Friday 14/12 at 18:00, the reason for choosing Friday was to allow people to grab a couple of beers instead of having to rush home :)

Please note that this event will NOT be free, you'll have to pay for your own food and drink. We expect that the price will range between kr. 200 - 300,- (beverages not included).

Please note that Bryggeriet needs to know how many people will attend so you have to commit to the date once you sign up. You need to RSVP no later than 23/11.

Practical Information

Geek Christmas Dinner will be held:

Friday 14/12 18:00

(Sign up before 23/11)

at:

Bryggeriet

Kannikegade 10 - 12

8000 Århus C

Map

Price kr. 200 - 300,-

As always please leave a comment to sign up.

Also remember to sign up before 23/11 so we know how many will attend. Keep in mind that we can seat only fifteen people, be quick.

Looking forward to seeing you there!

posted on Monday, 29 October 2007 21:38:33 (Romance Standard Time, UTC+01:00)  #    Comments [11] Trackback