Oct 16, 2010

Set sail for EF and WIF

Lately I’ve been submerged in studying a sea of new technologies (I know, I know — wasn't I supposed to be studying for a test?). I’ve been spending a lot of time at work (and at home sometimes) reading two books in particular, in addition to all of the videos and other online resources. All for the purposes of starting a brand new and ambitious project for work, which I’m quite pleased in the long term to be doing as it will be quite a boon for my career. In the short term, however, I feel like I’m drowning in unknowns.

Entity Framework is something that has been on my radar for some time, though I never got the chance to use it. I knew basically what it was, though, and I understand ORMs in general. Well, we’re going to start using it at work, which is great, but it also meant I needed to sit down and really learn about it.

Lucky for me, my work provided me with a copy of Julie Lerman’s just recently released 2nd edition of Programming Entity Framework. As far as I’ve gathered, Julie’s the authority on Entity Framework outside of Microsoft and the people who work it, to the point that even the EF team often asks her for input, suggestions, and the like. I’m about 120 pages in, it's pretty good, and I’m learning a lot, but it’s also well over 800 pages long. I’m also the type that really hates reading books out of order and I only skip chapters rarely when I’m sure that I won’t need it (and even then I feel a tinge of guilt). It’s slow going, but I’m really interesting in using it.

In the past, I’ve used a lot of different techniques for getting data in an’ out in my applications. Many of those I don’t do anymore and were more a product of me not being all that good at .NET yet. (Not that I necessarily am now, mind you!) Lately, I’ve mostly settled on using strongly-typed datasets (.xsd files) paired with stored procedures. SPs are more because of shop standards than personal preference. Typed datasets work well enough, but they require a lot of boilerplate code in the business logic and are still somewhat cumbersome to use in the presentation layer. Still, they do provide some nice benefits, such as being easily serialized, which we’ve used to great success for local caching in offline-usable apps.

I’ve had to put EF on hold for a bit while I delve into the world of authentication and authorization. Research lately has been into Windows Identity Foundation (another W*F!) and I’ve been reading the official Microsoft Press release on the foundation, aptly and functionally titled Programming Windows Identity Foundation.  It’s by some Italian with long hair who, like Julie above, is exactly the person you want teaching you this stuff. As far as WIF goes, he is the authority, actually works for Microsoft, and is heavily involved in promoting, designing, and developing WIF. Awesome.

He also has done extensive blogging, presentations, workshops, and now this book. Needless to say, with all of that evangelism/teaching experience under his belt his examples and guidance is particularly good. While Julie’s a guru and very knowledgeable, and her book is very good, I think she definitely lacks the teaching experience to make her book excellent. I don’t knock her for it, as teaching isn’t her primary focus, nor is being a good teacher something very many people are.

If you do anything .NET, you’ve undoubtedly at least heard of Entity Framework and more likely you, like myself a few weeks ago, know basically what it is. WIF, on the other hand, I will excuse you for not even having heard of, as it is far less marketed and applicable to most .NET programmers. It’s really cool stuff, and important, but it is really only useful to know about if you do authN/authZ. And I don’t mean just remembering to set authentication mode to Windows and identity impersonate to true in your web.config.

WIF is a pretty complicated subject to tackle, and one of my big problems with it at first is that after reading the Wikipedia article and the Microsoft page on it I still wasn’t really sure what the hell it was. I consider myself to be, well, at least not an idiot… so it especially bothered me. I think it is more to do with the fact that their descriptions are quite fluffy and abstract than me being dumb. Once I learned more, I see this is definitely the case, as most of the learning of WIF deals with very abstract concepts. It's difficult to explain simply and, for that reason and more, I’ll eschew trying to give an elevator speech about it now and instead cover it in a future post.

No comments:

Post a Comment