The newest EMVP: Fredrik Karlsson

This post was originally published on *http://labs.dropit.se/blogs.*

On Wednesday, one of our oldest employees (as in has been working here for a long time, not really being that old) was appointed an EPiServer Most Valued Professional, or EMVP. A big congratulations to Fredrik Karlsson!

I managed to get a little chat with him about how he feels about this and how he feels about EPiServer.

Johan: So, Fredrik, congratulations on becoming an EMVP.

Fredrik: Thank you.

Tell us a little bit about yourself, how long have you been working with EPiServer?

Well, I’m 30 years old, lives in Stockholm and slowly getting a little bit fatter for each year.

I’ve been working with web development since 1997 and with EPiServer since 1998. In 2000 I started working at Dropit and here I am today.

I see, and what is your current role at Dropit?

For the last year I have been involved in the development of Extension X3… err EPiServer Composer, but since EPiServer bought it I have been working in something called Expert Services here at Dropit. You might say I’m something as a developer handyman, doing everything from error search to specialized customer integrations…

What do you think is the greatest difference in working with EPiServer today compared to when you started?

When I started with EPiServer CMS 2 is was a VBScript/asp based website with frames. You can’t really compare the products. But I can say that EPiServer CMS 3 was nice because you had the ability to change almost anything. Then in EPiServer CMS 4 I think it was a small step backwards because it was a much more system. But now in EPiServer CMS 5 I think it’s a giant leap forward. Especially with a lot more generic MS controls rather then the homebrewed ones from EPiServer. Because lets face it, EPiServer is not that good in building web controls.

What does it mean to be an EMVP?

Apart from the small perks you get from EPiServer I think the biggest difference is that you are somewhat responsible for the reputation of EPiServer. If an EMVP writes something insulting, it will reflect on EPiServer and not just the person. Especially now with EPiServer gaining a larger international market. But to be honest, the thing I look forward the most is probably the clothes.

What do you anticipate most in the next release of EPiServer?

MVC. Please, please, please EPiServer!

Why do you think EPiServer is still relevant today after so many years?

They have been rather successful in implementing new techniques and so on. But I believe the key factor is that it is very good for novice advanced beginners. Its really easy to get started witch give them an ever expanding user base. Especially with the demo templates and likewise.

What to you think is EPiServer’s greatest challenge in order to keep being relevant in the future?

To be true to its core business and not try and do something they are not that good at. But first and foremost to listen to the EPiServer user/developer community, Today this is EPiServer weakest part by far. Sure, they say they listen to us, but it’s lacking so much in information and the possibility to give to the community.

Thank you, Fredrik, for taking the time to answer my stupid questions.

No problem. Can I say hello to my colleagues??

No.

Why doesn't EPiServer.DataFactory implement IPageStore anymore??

This post was originally published on *http://labs.dropit.se/blogs.*

We recently upgraded our project to EPiServer 5 R2, and that made some strange things happen. I had a class that uses the EPiServer.DataFactory to manipulate pages, and in order to make it testable, I had the following constructors:

1
2
3
4
5
6
7
8
9
10
private IPageStore _pageStore

public NovaImporter() : this( EPiServer.DataFactory.Instance )
{
}

public NovaImporter( IPageStore pageStore )
{
_pageStore = pageStore;
}

This worked just fine before we upgraded. But now it turns out, in R2 DataFactory doesn’t implement IPageStore anymore. In fact, the only interface it implements is IPageSource, which is pretty worthless in this context. Of course, DataFactory still have the same methods, so it could *implement IPageStore, it just… doesn’t. And to make things worse, DataFactory is *sealed**, so you can’t really mock it at all, and it only implements PageStoreBase (which only contains event handlers), and the aforementioned IPageSource. So basically, EPiServer just made it impossible to write unit test for anything using the DataFactory. Thanks.

Why, oh why did EP decide to change this? Anyone know?

LINQ in .NET 2.0

This post was originally published on *http://labs.dropit.se/blogs.*

Good news for everyone currently supporting older projects (.NET 2.0): You can use LINQ and Lambda-expressions in .NET 2.0! At least if you’re using Visual Studio 2008 (which there is no reason not to do, is there?). The trick is that VS really use the same compiler for 2.0 and 3.5, and since LINQ is only a language feature, it is able to translate it to the same IL-code anyway.

This blogpost on elegantcode.com explains how you do it.

If you’re still working in a .NET 1.1-project (god forbid), you’re out of luck.

Unionen.se praised on IDG

This post was originally published on *http://labs.dropit.se/blogs.*

When you’re working in this line of business, developing web sites, that is, you’re not that used to praise. Once a web site has been launched, most of what you hear is bugs and new feature requests. But once in a while we get the praise we deserve! :-)

Today the Swedish magazine internetworld published a review of the public web sites for 6 of Sweden’s largest unions. The site I have been working on, unionen.se, got 9/10, and a splendid review, the title of which reads “Good looking and smart in a modern suit“.

I worked on unionen.se pretty most of 2007 as a Scrum master and systems architect. It was one of our first real Scrum projects here on Dropit, and I dare say one of the most successful ones so far. One the most important reasons for that was that we had a great Product owner (Karin), but also that we were a very good and dedicated team (you know who you are!). Dropit was responsible for the whole delivery, so we worked both with the conceptual and graphical design as well as with the technical implementation. The site is based on EPiServer 4.62 and our internal framework Foundation.

We had the privilege of having the whole team sitting together with the customer, which wasn’t the standard way to do it for us back then. Since then we are advocating this more and more, since the collaboration with the customer really improved. It was also a technically challenging project, as we were heavily dependent on the SOA infrastructure being developed simultaneously, and we even had to work on New Year’s Day to make the launch. But it really paid off, and it’s extra fun for this to get recognized on idg.se!

So once again, thanks to all the people that worked so hard to create unionen.se!

Simple source control with Subversion and Dropbox

*This post was originally published on http://labs.dropit.se/blogs. *

I noticed that the activity on this blog has been a bit low lately, probably due to the fact that everyone has been away for the holidays. Instead of nagging on everyone to start writing again, I though I should lead by example and write an entry myself first. :-)

This is on the same theme as my previous entry, Keeping things in sync, where I went on about how happy I am with Dropbox and Evernote to have access to all my important files and notes on all computers. Since then, I have discovered another great way of using Dropbox.

I usually work on a few projects outside of work, and although I do want source control on these (mainly for the versioning), I can’t put these in our TFS. So I did what every responsible developer does; set up a VisualSVN Server on my computer and use that one for the verison control (I use AnkhSVN for the VS integration by the way, works almost flawlessly for me). But now it happens that I have another computer at home, one that is faster (dual core E8400) and has a bigger screen (24”), and when I’m at home I like to use that one for programming instead of the laptop I use at work (Thinkpad X301, lots of name dropping here). One way is to turn on my laptop and connect to the server there. But that seems like a lot of work. You know, turning on the computer, finding out what IP the DHCP has assigned to it today and so on. And what if I left my computer at work?

Enter Dropbox. Again. I simply created a new folder in my dropbox folder, called SVN-repositories. Then I installed VisualSVN Server on both computers, and set it up to use the SVN-repositories folder to store the repositories. Done!

So now I have a local SVN server on both computers, that automagically keep in sync. If I do some work on one computer, the next time I start the other one Dropbox will inform me that it has updated a few obscure SVN-files, and that’s it. Wunderbaum!

A word of warning though. I have no idea what would happen if you were to change data in both repositories at the same time. Probably something bad. Wouldn’t try it.

Page being loaded twice

*This post was originally published on http://labs.dropit.se/blogs. *

Ever had the problem of pages being loaded twice, that is that all the events are being hit two times?

I have, and I’ve never really been able to figure out why, but I recently stumbled over this old entry at ASP.NET Resources. It seems that it is a problem with AutoEventWireup, or rather it is a problem if you use both AutoEventWireup *and *wire the events in the codebehind as well. You can read the full story on ASP.NET Resources, but it seems that it is obviously very important to be consistent in your choice of using AutoEventWireup or overriding the methods, and *not *using both of them!

I know we have this problem in our current project, so I guess I’d better track down all Page_Something-methods and AutoEventWireups and turn them off. Seems to be the easiest way to get rid of this.

Never use HttpContext to access the Cache!

This post was originally published on http://labs.dropit.se/blogs.

This has probably been said a million times, but it’s definitely worth saying again. Never use HttpContext.Current.Cache, always use HttpRuntime.Cache.

Why?

Because HttpRuntime is always available, even when you’re not in a web context (e.g. even in a console app), and HttpContext is not. And it’s the exact same Cache! Do you, for example, think that you have access to the HttpContext in a unit test? Probably not. HttpRuntime? Of course!

So, to sum it up:

1
2
3
4
5
//Bad code
return HttpContext.Current.Cache["myitem"];

//Good code
return HttpRuntime.Cache["myitem"];

Keeping things in sync

This post was originally published on http://labs.dropit.se/blogs.

Since my laptop got stolen a couple of weeks ago, I’ve become pretty paranoid about not having the only copy of things I’m working on on my laptop. Luckily, I’ve found some free tools to help me with this, and I must say, not only do these tools ensure that if my computer would get stolen again (or more likely, get left behind at a bar :-)), I wouldn’t lose any of my work, they have also improved my life considerably!

And I’m not even talking about any Google-tools, I’m kind of old fashioned, and like actual applications.

The first, and most important thing, is Dropbox. Dropbox gives you 2 GB of free storage in “the cloud” (remember when it was called the Internet?). And best of all, it installs itself as a folder in my Document folder, and syncs itself with no interaction whatsoever from me. So I have installed it on both my work laptop and my home computer, and suddenly I have a folder that is shared between them. And if I’m not at any of my own computers, I can access all my documents with a web interface. It even has version control, which makes it better than a local folder, even disregarding the sync stuff! So now all my work stuff, and private stuff that is not totally unimportant, goes in my dropbox! And if you’re into that, it even works on Mac. And Linux

Dropbox also helped me solve my long lasting password-storage problem. I use PasswordSafe to store my password, and have configured it to save the files in my dropbox. They are of course encrypted, so not even if someone would gain access to my dropbox, they would get access to my passwords. But this way I can see my passwords on all my computers, and I know they are secure. If you have a second computer that is a Mac, or even a Linux box, you can use Password Gorilla, which uses the same file format. In all fairness, I didn’t come up with this particular solution myself, thanks Joel Spolsky for that!
My final tip is Evernote. I used to use OneNote. But then my computer got stolen, and suddenly all my well-organised, searchable notes were gone. Evernote is more or less the same thing. But it syncs with, well, the cloud (a server on the Internet, really). And I can access my notes from all computers, from the web, even from my cellphone. And they are nicely tagged, and searchable. I could of course use Notepad, and save the notes in my Dropbox. But this is nicer. You really should check it out!

That said, I think I’ll try not to lose my computer this time.