The dynamic programmer
.Net framework and languages
Yesterday Scott Gu post again about the MVC framework. Don't miss his post about Passing View data from controllers to view.
In this second part we look at the factory methods to handle the different request and the formatters classes.
If you haven't look at it, take a look at the Subsonic project, is really cool and can generate a ORM infrastructure faster than any other framework I tried out there. It also provides a cool HTTPHandler to expose those objects.
In the altnet conference the guys from Microsoft presented an MVC framework that will be released on the spring. It promise to be something really good, it's seems to be so flexible that you can plug into it whatever framework you are used to.
I'm trilled to discover that I'm not crazy and that my search and adoption of alternative tools (alternatives to the Microsoft tools) to develop in .net is a philosophy adopted not only by me but for a lot of people. It even has a name ALT.NET.
My own validation library for .Net that introduce a simple DSL to make validation of arguments and method calls easier and less annoying.
On how using MVC 3, NuGet, MvcScaffold, EF code first, Git and AppHarbor make me have fun again using the Microsoft stack.
I decided to completely isolate Luca from the HttpRequest object and define my own. The main advantage of this approach is that having a pure javascript object, mocking and stubbing is extremely easy, making testing a breeze.
As a first simple example of using Luca I wanted to write a simple web service that returns json or plain text.
The JavaScript engine allows for the use of .Net objects inside JavaScript, but I wanted to completelly abstract Luca from anything related to the HttpContext.
I wanted a very simple framework more like Sinatra than Rails. Something that make very easy to put together some simple Restful websites. And I wanted to use JavaScript to write my code and be able to run it inside .Net and IIS. But first I needed to find my JavaScript engine.
I heard about NSubstitute on episode 26 of Talking Shop down under. It sounded like an interesting framework with some interesting ideas, so I took it for a spin.
The code in this post is of demo quality and should not be taken as production ready code. It's a first take on the project and will evolve during a series of posts. Blogengine.net is an open source blogging platform written in asp.net.
Kazi Manzur Rashid has a post about registering Areas dynamically after the registration of other routes and the problems this has since the order the routes are registered is very important.
The NoSql movement is gaining more and more momentum. A year or two ago I took a look at CouchDb but this time I wanted to try MongoDB.
The other day at the office my boss took a look at our configuration files and he expressed his concern about breaking DRY with all the ConnectionStrings. One for Ado.Net, one for NHibernate, one for our caching db and another for Log4Net.
Hopefully gone are the days were you considered ok the use of single letter names for your variables or your arguments and you are giving informative names to all the artifacts in your code.
One new feature in the code editor is the ability to put sticky notes in the code while debugging. This sticky notes are actually attached to a given variable and you can see the actual value of it in the note (similar to using the watch window).
This post have been inspired by the talks about controllerless actions. This is NOT an alternative to that. Controllerless actions is an interesting concept that should be study. Actually Jeffrey Palermo has a concept implementation.
In the context of this article every time I mention Linq I'm actually talking about Linq To Objects. Although Linq has a very handy method on FirstOrDefault<T>.
If you ever played with some language that have the Tuple type I bet you miss it in .Net. Well 4.0 adds it. Let's see what the ubiquitous Wikipedia have to say about it.
A very good presentation with lots of code to learn and appreciate some of the niceties of ActiveRecord.
I want to be positive in this post. So I will just mention this once. The framework is very extensible but It's more difficult that It should. I guess that the problem is not really with the framework, but me trying to make it do something that is not in the spirit of it.
Today I have the pleasure to listen to a really good episode of The Herding Code. The episode title was NHibernate performance. In the episode Ayende, David Penton and Ben Scheirman talked about NHibernate and the performance of the tool ...
If you have been following this blog, you probably saw a few posts about what's going on behind closed doors once you submit your code to the mercy of the compiler.
I enjoyed this chapters as well, specially chapter 6 and 7 about extending the framework and preparing your site so it scale. Some of the code examples are using a previous (old) version of the framework. I hope they will be updated for the print version.
In my previous post I mentioned how to integrate Visual Studio with Subversion for free and without having to install fancy plug-ins.
Now there is another choice and is a set of configuration options to access TortoiseSVN from inside Visual Studio. The set of configurations provide a tools menus, context menu, and menu bar.
In this post I wrote about wrapping log4net (as an example) in your own logging class and define an interface for the log object that better reflects your domain.
On episode 20 of the Elegant Code Cast Matt Heusser talks about testing in general and the role of QA in an agile team.
I just finished a complete re write of my validation framework. This re write was due to feedback received from some of my co workers so I owe to them my thanks.
You can find this new ORM framework at http-//code.msdn.microsoft.com/XGENOORM. Starting with it is fairly easy. Just add a reference on your project to the very small (32K) dll (only one!) and you can start playing with it.
A few moments ago (55 minutes to be exact) Chad Myers made a commit on revision 55 of the FubuMVC enabling this to run using F5 inside Visual Studio, using Cassini.
Herding code interview with Chad Myers and Jeremy Miller on FubuMVC
If you use Cruise Control.Net you may want to take a look at this project. CC.Net Community PlugIns
We are living in very exiting times in the .Net world. Every time I look I find a new framework to do web development. I recently found FubuMVC. This framework is a bit different from Sharp Architecture or the Catharsis guidance
Once in a while I like to browse around Codeplex to see what's new and if I found anything interesting. Today I found this Gem of a project called Catharsis. To be able to use it you will need VS 2008 with SP1.
Every time I wrote validation this code I think, I should write a library to do this for me. So I went ahead and wrote this simple class. The idea is to use the Introduce Assertion Refactoring in this cases and write this code in this way. ...
CAT is a Visual Studio Add-in that analyze your code and all the references in your project looking for vulnerabilities to common attacks.
In my machine at work I can't install ASP.NET MVC (it installs but fails to install the project templates, I don't know why and I haven't had time to look into it).
At least two really good post today about the future RC1 for the ASP.NET MVC framework.
Pronounced Sharp Architecture, this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate.
This is a plug-in for Resharper that allows you to use Reflector and and the .Net framework source code to navigate your code. You can download it from the Google code project page.
I will try to create a simple CMS framework on top of the ASP.Net MVC. This will be mostly an exercise, something that I feel I need to try to see how it works.
C# format is an online tool to format your C#, VB, HTML, XML, T-SQL or MSH code into valid HTML 4.01 complaint code to put online.
In the last few days two of my favorite pieces of software released new versions.
A few weeks ago Jeffrey Palermo published his notion of an Onion Architecture. The first time I saw it was during his MVC presentation at DevTeach Toronto and I really like it.
In my previous post I show how to integrate PartCover reports into CC.Net and promise to look into make the reports look a bit nicer and try to integrate the Coverage metrics into the statistics reports. So I dust off my xslt ...
A few months ago I mentioned that I was using PartCover.Net to measure test coverage in my projects. I have been really busy but I decided that this week I was going to integrate the reports with CC.Net. Cruise Control ships with NCover support o...
I was creating for the 10th time today a nant build file from Visual Studio when I came to the realization that I needed to automate the process a bit more. So I created an item template to include build files. You just need to copy this zip file...
Notes on Beth Massi and Scott Hanselmann presentations at the TVBUG.
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.
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...
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.
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...
I have found some controversy in some post in the wild where I demonstrate how to extend the string object. Sometimes the controversy is around the examples presented. So I decided to make my own example with methods that I wish were included in the framework.
I went today to the Nant site to check some documentation and I saw that the beta 1 of the new version is available, this version supports the .NET 3.5 framework, Mono 3.5, Silverlight 2.0 and Moonlight 2.0
Prototype is one of the most popular javascript libraries out there and one of the features I really like is the template implementation. When you create an Ajax application there are multiple opportunities to use templates in the client side.
They talk about LINQ and the changes needed to support it in c#. There is a very interesting point on Extension methods a feature that fascinate myself and scare me a little bit. It's so cool that I know that we will overuse it at the beginning.
This is a cool example of using LINQ to query and filter an array. I like this use of LINQ.
I have been using DooDads, a free, open source ORM architecture for a while now. I like that I can easily use it with any database structure, not matter how bad it is.
The CTP release of the Microsoft MVC framework is available with the ASP.NET 3.5 extensions.