Saturday, December 29, 2012
Thanks for those who participated in my sessions in Expert Days! I hope you enjoyed it. For your benefit and also for everyone else that didn’t participated, I uploaded all the materials online so you can browse whenever you want. You can find all the materials here. In the above link you’ll find the following files: For the “C# in Depth” session you’ll find: The presentation All the demos (except for the Roslyn project demo) The Roslyn project demo For the “Software Quality –...
Saturday, September 15, 2012
From time to time I encounter a problem that seems pretty straight-forward to implement without TDD, but very cumbersome to do with TDD. Most of these cases have something in common: they describe interactions between the tested component and external parties. These external parties can be either the user, external system, or any kind of communication protocol. Here’s the simplest example I could think of: This is a simple console application that asks the user for his name, and then greets him with “Hello, “, followed by his name. Writing this application takes exactly 3...
Wednesday, March 21, 2012
Time and time again, when I'm reviewing code of pretty experienced programmers, I'm still shocked how they're using Copy & Paste programming extensively instead of extracting common code to shared methods and classes. Visual Studio and many 3rd party add-ons tools make it very easy to make these refactoring that allows to avoid any duplication. But still – Copy & Paste is easier and that's what many programmers use by default. Frankly, I chose the title for this post just to tease. Clearly there's nothing wrong with the Copy & Paste feature of Visual Studio. The problem is...
Sunday, February 27, 2011
As I promised in an earlier post, I’m publishing the hibernate-mapping.xsd to which I’ve added the documentation, and you’re the first to know!
So now you can enjoy IntelliSense tooltips while your editing your *.hbm.xml files, like this:
I’m trying to contact NHibernate owners in order to submit this to the official NHibernate source files, but I’m still waiting for their response. In the mean time, you can be the first to enjoy it by downloading it from the link below.
Wednesday, January 19, 2011
As always with tips, either you already know this or it would be invaluable. This time I'm talking about 2 configuration properties: "show_sql" and "format_sql". To switch on these options, add the corresponding lines to your hibernate.cfg.xml file as in the following example:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.connection_string">Data Source=.;Initial Catalog=NHibernateDemo;Integrated Security=True</property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> <property name="show_sql">True</property> <property name="format_sql">True</property> <mapping assembly="BusinessLogic"/> </session-factory> </hibernate-configuration>
What is does?
The “show_sql” property tells NHibernate to output all the SQL statements it executes onto the console. This way you can see exactly what...
Tuesday, January 11, 2011
If you're using NHibernate and writing your NHibernate mapping files (*.hbm.xml) by hand, (as opposed to using Fluent NHibernate for example), then you'll probably be interested in the following tip (unless you already done that :-) )
You can have IntelliSense validation and auto-completion in the XML editor for NHibernate xml files (both the *.hbm.xml and hibernate.cfg.xml) by following the following steps:
1. Inside VS, select XML->Schemas.
2. Click "Add..."
3. Browse to the "Required_bins" folder inside of your NHibernate folder (e.g. "C:\Nhibernate3.0\Required_bins")
4. Select both "nhibernate-configuration.xsd" and "nhibernate-mapping.xsd" file and click "Open".
The 2 schemas will be added to the list:
5. Click OK...
Tuesday, December 21, 2010
In the recent project I’m working on we’re using Fitnesse, which is a very nice acceptance testing framework. Probably because Fitnesse was aimed initially at Java developers, it doesn’t have a very good integration story with VS. The main problem is revealed when you try to debug a User Story, because there isn't a "debug" button in Fitnesse. When you run a Fitnesse user story it invokes a new process (called Runner.exe) which calls your code, and finished very quickly, which makes it practically impossible to attach to it.
The way other people in the team worked before I came...