REST, a video about it, and a book to rule them all.
I seriously believe that REST is a simple and yet powerful architecture that can be used in most scenarios where web services need to be deployed.
This week the good guys at infoq.com have an interview with Pete Lacey a fervent proponent of REST where he explains the reasons behind his passion. He talk about it and about the WS* stack and why he things that is bloated and not very useful.
I tend to agree with him in most of his opinions specially when talking about security and transactions. I do think that HTTPS is good enough (not actually is very good!) and you can on top of that roll your own security. On the issue of transactions I always thought that not just web services but services in general should be transaction agnostic.
What I mean with transaction agnostic? The service may be part of a transaction but should have no knowledge of it. So the service will receive a request with a payload and sometimes, maybe, return a result. So when you delegate work on that service you should account for that maybe, what happens if the service is not available, etc.
DevTeach day 1 - Scott Hanselman keynote
Following to yesterday presentation at the TVBUG, Scott Hanselman gave the keynote on Data Services and Dynamic Data.
Both of this two (products?, projects?, solutions?) are focus in different ways to provide access to your data.
Dynamic data allows you to very easy and quick create all the admin forms for a given database (similar but different to the scaffolding on Rails).
The main difference is that there is not code generated for the pages you see.
All the code is based on templates and every rendered field is based on templates as well, so you can very easily change the way a field will render.
Data services was already covered in my previous post about Scott’s presentation at the TVBUG.
Linqy batch of goodness - TVBUG meeting with Scott Hanselmann
Scott Hanselmann and Beth Massi both gave a presentation today at the Toronto Visual Basic User Group about LINQ in general.
Beth created a windows form app using VB.NET, LINQ to XML to and LINQ to SQL to read data from three different feeds and populate a simple database.
She presented some nice queries and gloat a little bit on some of the goodness of LINQ on VB, making some good spirited jokes for the C sharp guys in the audience (like myself).
Scott give us a nice preview of Astoria (ADO.NET Data Services) and show up some of the internal working, (how the magic happen as he put i). I really like that part of the presentation since I really like to know what’s going when code is generated by the IDE.
Data Services allow you to present some entities as REST services, it return both XML (Atom) and Json. Data Services comes in the new VS 08 and .NET 3.5 SP1.
I will going to check it out as soon as possible.
Heroes happen here - Toronto
I’m not always exited about Microsoft launches but the 2008 series (Server, Sql, VS) is quite good. So I went to this event with the highest expectation, hoping, for once, to be able to learn something.
I chose the Architect track, since I have been playing (and using) VS 2008 since the beta 2 version and I have time to at least give a try to most of the new features, the developer track wasn’t promising, since they were going to demoed all the features I already know about.
The architect track seemed more promising, the first sessions was about SOA and how to implement an SOA in your company with the new tools, something that I’m actually doing right now.
I should have known better. It started very good but rapidly became clear that was mostly a marketing pitch on how wonderful the new products are and how theya re the perfect tool to implement this type of architecture, without given any example or covering any real topic. It was a shame since the presenter looks like a very intelligent and articulate person.
The next session was as wasteful as the first one, and once again I bet that the presenter was dying to give more details, but nothing.
Both sessions ended up calling a Microsoft Partner to present a solution they developed using the new stack, so I lightened up and open my ears hoping to learn, see something. Once again a bunch of slides where, instead of give a problem and a solution to it, they keep repeating the same bullet points that I saw during the whole day.
I want to make clear that I wasn’t expecting to see a demo, I was counting with these sessions to be highly theoretical, similar to the sessions you can get in infoq.com or some of the chats on ArcastTV, but no, both sessions were a waste of time, at least for me. No real discussion or ideas presented.
I will give it to Microsoft that may be if you are a professional that didn’t have time to play with the tools, the presentations may serve as a way to open your eyes, so you go and give them a try, but it wasn’t good for me in any level.
Well, that’s not completely true, I got a mini basketball hoop and a mini basketball ball for my kid.
Testing your asp.net pages with NunitAsp (and no web controls)
Testing is fundamental to get your code into shape and to be sure that what you are doing is behaving as expected. New methodologies like Test Driven Design (TDD) point to that goal. We (developers) are lazy and very self confident, we normally write the code and run it a few times without paying a lot of attention of the requirements, if the code works as we think it should we are happy and move to code something else (or write some blog post
).
So the idea behind TDD is that instead of write your code first and test it later, you start by writing your test (hopefully something that tries to follows the requirements, if not there is no much good on the practice either), them you run your test you see it fail and run the code that will make the test pass.
This post is not about TDD, there are tons of articles out there on how to do it. This post is about how to do TDD on web development (even if you don’t use web controls).
The SmartBag to replace the ViewData on MVC
Jeffrey Palermo posted about replacing the ViewData on the MVC framework with a generic container called SmartBag.
The advantage is that the container will return an object of a given type, so no more casting and also no more using string keys to get a given object since the type is used as the key.
Palermo’s code take cares of 80 per cent of the usage cases, the only issue will be if you have more than one object of the same type in the smartbag. Jeffrey is asking for feedback from the community so don’t hesitate and provide it.
I made a small modification of the code to deal with the 20% of cases stated on the post. Here is the code with those changes.
CSS parser class in .NET
We are changing our template system at work and my boss ask me to look around for a css parser class.
The class needed to load a bunch of css files and parse them to be able to get a value from an attribute of a given key.
The class needs to be "inteligent" enough to apply some precedence rules so the latest css file will override or augment the previous ones.
After doing a quick search in google I couldn’t find something that could help us, we needed something simpler with little overheat, so it was time to write my own.
PartCover the Code Coverage tool for me
A free tool to do code coverage with a nice GUI for the developers to use, that can be run on the command prompt, that generates nice xml based reports (to integrate with your CC server) and best of all for me) that works fine with Static methods.
This gem is called PartCover.
The importance of code review
I have been working in different companies where the practice of an Agile methodology is in place, but in most of them the part that is always left behind is pair programming and/or code review.
Let me explain the factors I usually see affecting this decisions.
Pair programming:
It’s usually difficult for managers to grasp the concept, they see having two developers working in the same code as a waste, no matter how you explain this to them they just see two head counts doing th work of one, and that is not good for them.
Code review:
Time is of the essence and the believe of some managers is that if the code pass unit testing, integration testing and QA, the code is good and there is nothing to be gain with code review, because the code "works".
Free virtual machine software
Virtualbox is a free open source virtual machine software. I have been using it to run, Ubuntu, Fedora, BDS and a virtual XP machine with all the new stuff for testing and I love it.
The performance is great, installing the software can’t be any easy and configuring the virtual machines is a breeze.
I totally recommend you give it a try.