DarksideCookie

Come to the dark side...we have cookies!

Emancipating your Entity Framework entities

Ok, so first of all, it has been a VERY long and VERY quite period on my blog. I guess that is just the way it is, sometimes life just takes up too much time to be able to blog to the extent I want to. On the other hand, I have been very busy with some cool projects, including some cool technologies, so it is all good I guess.

Now back from the dead I hope that my blogging will pick up, and this is the first in a series of blog posts about things I have figured out during my silent months. I know that Entity Framework is far from what I normally blog about, but it is still something I use, and something I spent some times getting my head around. Understanding EF as such isn’t that hard, the hard part was getting it to work in a fashion that suited me, and one of the things I don’t like is just adding a gazillion repositories on top of EF and be done with it. And I don’t like stepping 15 levels into my objects, lazy loading things as I go along. And I want things to be as DRY as possible. So I prefer having more “emancipated” objects. I want my objects to have freedom to do what they need to do. This makes the programming so much simpler and easier to follow… But it also requires some features like DI… And on top of that, being a bit paranoid, I prefer abstracting away my ORM as much as possible…

So this post is about how I have decided to use EF in my current projects, and I would love any feedback you got…

More...

Posted: Oct 18 2012, 15:48 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

WP7 Database Support – The Quick and Dirty Intro

I finally got my act together and started doing some WP7 development again. It has been a while, and a few things have happened since I was last doing it…Mango for example. This also means that there are a heap of new features available to me as a developer, but the one that I have got real excited about is actually the database support…

So, Chris, being who you are, why in the world did you chose that feature to get excited about? Well, partly because it was the first new feature I have tried out. But mostly because I sort of didn’t expect to be as neat. Knowing that it was based on SqlCE, I sort of expected it to use a subset of ADO.NET, and regular SQL for access. However, color me surprised when I realized that that wasn’t the case. Instead, it uses Linq-to-SQL and attribute based entity mapping. And on top of that, I didn’t have to create a base database and include it in my project in some obscure way. The database can be created based on the attributes, which is a nice little treat…

More...

Posted: Jun 25 2012, 11:08 by ZeroKoll | Comments (1) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Windows Phone 7
Manage post: :)

Code from my testing presentation

Last week, I had the honor of having been invited to present my thoughts on testing at a IT consultant agency here in Stockholm. And even if I looked forward to it, and felt privileged to be allowed to share my view with these other devs, I still felt a bit hesitant. I was still going to step in front of a bunch of devs and present a somewhat less glorifying view on testing than you normally get. Not that I am all against testing, definitely not, but I do have a somewhat looser view on what, when and how to test software than say for example you regular TDD guy…

Walking in to the presentation, I had material for about an hour of presenting, and hoped to maybe extend it to an hour and a half with discussions and debate (I did hope for a lot of discussion as it was really the goal of my presentation). However, it turned out that after an hour and a half, we had a break for food, and then I kept going a bit more. I think we ended the session after almost 3 hours, even though I think it could probably been longer if I had pushed my points a bit more to the extreme than I did.

More...

Posted: Jun 19 2012, 18:07 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Personal | Speaking
Manage post: :)

Securing a NancyFx module with the Azure Access Control Service

In my previous post I gave a semi-quick introduction to NancyFx. This time, I want to take Nancy and combine it with Azure ACS. Not a very complicated thing as such, but still something I want to do as I enjoy working with both technologies.

Just as in the last post, I will self-host Nancy in a console application, and use NuGet to get it going. I will also re-use the “www.nancytesting.org” domain I set up in my hosts file in the last post.

Once I got my console application going with a host, and an empty NancyModule, it is time to start looking at the ACS.

More...

Posted: May 08 2012, 20:50 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .NET development | Security
Manage post: :)

Trying Out NancyFx

As part of not doing very much coding lately, I have decided that I am going to try to spend more time trying out new frameworks and technologies. And hopefully, that will en up with a lot more blog posts with interesting stuff. This time I have looked at a ridiculously funky micro framework for building HTTP-based services called NancyFx. It is really simple to get started with, but still very powerful…and modern…

Nancy can be hosted in a variety of ways, including in ASP.NET MVC, WCF and self-hosting. In this post, I will look at hosting Nancy in a console application as I had little interest in setting up anything big. And using NuGet, it was a piece of cake to get started. Just start up a new Console application project and then NuGet Nancy.Hosting.Self.

More...

Posted: May 06 2012, 12:53 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .NET development
Manage post: :)

Sample code from my LEAP presentation about cross-framework code sharing

Yesterday I was invited to speak in front of a bunch of really sharp guys attending the Lead Enterprise Architecture Program, LEAP, at Microsoft here in Stockholm. The topic of the day was how to share code between projects targeting multiple frameworks/platforms. Basically “how can we share code between projects aimed at WP7, Windows 8, Silverlight and WPF” in a useful way, limiting the duplication of code as well as maintenance.

Most of my presentation revolved around a sample I had written to target all platforms. It is a very simple application, but still shows that it is very possible to get it to work.

More...

Posted: May 04 2012, 09:11 by ZeroKoll | Comments (2) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

A Rant About Unit Testing and Stuff

I think it is time for another rant. Actually I really don’t, as my blog is supposed to be about coding, not about me ranting… It seems like my blog has slowly gone from code centric posts, to ramblings of a grumpy Microsoft developer. Sorry about that, and I promise to focus more on code in the future…

Lately I have travelled around and talked at a bunch of conferences, and heard a lot of really smart people talk about a lot of really cool things. This got me thinking a bit about my own way of dealing with new technology, as well as about my own way of doing things today… The result of this thinking is that I am going to try and make 2 changes. First, I am going to try and get out and about and try more new stuff. More frameworks, technologies and maybe even more languages… Hopefully this will fuel my blog with more code related posts as well as interesting revelations and thoughts. Secondly, I might have revisit my stance on unit testing and TDD…

More...

Posted: Apr 19 2012, 16:40 by ZeroKoll | Comments (2) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Personal
Manage post: :)

Code from MVVM presentation at DevConnections

At my MVVM session at DevConnections, I promised to put the code on my blog for people to have a look at. So here it is!

Download: DevConnections.MVVM.zip (36.64 kb)

Posted: Apr 03 2012, 09:10 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Personal
Manage post: :)

Another good conference at an end

So, here I am sitting at the speakers lounge at DevConnections at the MGM Grand in Las Vegas after another great conference. It is amazing the level American conferences keep. The speakers are great, the conferences are well organized and everything just flows. And it is pretty cool to be able to share the speakers lounge with people like John Papa, Dan Wahlin, Paul Litvin, Juval Löwy and Scott Hanselman. It is also very humbling. These presenters are really the cream of the crop, and I am still kind of wondering what I did here. But I got to do it, and had a lot of fun, so I won’t complain.

More...

Posted: Mar 30 2012, 02:00 by ZeroKoll | Comments (1) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Personal
Manage post: :)

Keynote with Scott Scott Scott

Ok, so tonight's keynote with Scott Hanselman was interesting to say the least. Hanselman is always fun to listen to, and I would consider him a pretty brilliant presenter. Today, while waiting for his keynote to start, he showed a bunch of interesting things on the projectors. As I sat down, he had legacy machines booting, or at least showed the boot sequence of old Mac OSs, Amiga, Commodore and Windows. Quite funny…and after that, he just browsed around the web showing off a bunch of really funny websites. Sites like http://sometimesredsometimesblue.com/ and http://isitchristmas.com/. He also showed off a video with Steve Ballmer singing, an org-chart of Microsoft with each unit pointing guns at the other. And yes, he also covered in depth his relationship to Scott Gu… And the some!

And however ridiculously funny it was to hear him talk, and hear him joke at the expense of Microsoft and boost a few open source projects, it was not the main attraction. The main attraction was when he found a missing feature in ASP.NET MVC, said that he wanted it fixed but that they were too busy. So he open sourced ASP.NET and asked one of the Mono guys to fix it by getting it off Codeplex using Git… Very funky!

More...

Posted: Mar 28 2012, 08:04 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Personal
Manage post: :)