October 2008 Entries
Yesterday Colin Jack and Jimmy Bogard had a fantastic exchange on Twitter about dealing with collections in your Domain model, and Derick Bailey also blogged about his thoughts on the matter. While I didn't take part in the conversation, I did have a conversation with him at ALT.NET UK about his solution and blog post.
The Twitter conversation lead to a discussion about both proposed solutions with a friend of mine that is starting a Greenfield project and I thought I would join the bigger conversation too. I'm not going to show any code, as Colin and Derick already have great examples.
Custom...
I recently posted about using SQLite to speed up integration tests when using NHibernate and one of the issues I was having was the inmemory database being dropped. I had been meaning to spend some time working out what the problem was but Justin Etheredge has done the hard work and figured out the solution!
Check it out here: http://www.codethinked.com/post/2008/10/19/NHibernate-20-SQLite-and-In-Memory-Databases.aspx Good job Justin, I owe you a pint!
So, for those of you that use Binsor, the updated script now looks like this:
settings(keymap, item: 'item'):
provider = 'NHibernate.Connection.DriverConnectionProvider'
connection.driver_class = 'NHibernate.Driver.SQLite20Driver'
dialect = 'NHibernate.Dialect.SQLiteDialect'
connection.connection_string...
Tonight was supposed be the ALT.NET Glasgow Python Code Kata, unfortunately this had to be postponed because of problems with the venue. Instead, we're meeting for drinks at Wax O'Conner's. I was discussing this with someone who suggested the still having the gathering was a waste of time as we will not be covering any code.
I couldn't disagree more with this. For me, enabling converstations is one of the main tenents of ALT.NET. Be it blogging, podcasts, tweets or an argument over a pint, as long as we talking then we're doing out part. I like to think the things...
We rolled out the first drop of an internal web application today. Quick trip to TeamCity, fire the Release build and wait for the ZIP to be spat out at the end. Bing! Less than a minute later we have a fully tested deployable version of the site all zipped up.
We uploaded it to the server, hit the index and... nothing but a Yellow Screen of Death, ""The view 'Index' or its master could not be found.". Uhoh.
A quick look in the ZIP confirmed that the Views folder held only a lonely looking web.config file. Not exactly what was supposed...
One thing I love about using NHibernate as my O/RM is being able to push the database schema from the domain. This lets me create the database from scratch for each integration test fixture and get it into the required state. Creating the database with NHibernate is quick and simple. Hell, here is the code to do it:
Configuration cfg = container.Resolve<Configuration>();
SchemaExport export = new SchemaExport(cfg);
export.Execute(true, true, false, true);
Nifty, eh?
But tests that hit the database are sloooow, and these quickly become tests that are not ran. Tests that query the database are slow, and because I regenerate the whole database...
I use Binsor for configuring Castle and Spark as my default ViewEngine for ASP.NET MVC. This is how I register and resolve the ViewEngine
container.boo
component "Spark.Web.Mvc.SparkViewFactory", IViewEngine, SparkViewFactory
component "Spark.FileSystem.FileSystemViewFolder", IViewFolder, FileSystemViewFolder
global.asax
container.Install(BinsorScript.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "container.boo")));
ViewEngines.Engines.Add(container.Resolve<IViewEngine>());
First thing I want to say is that Spark is a very very nice ViewEngine. After the resulting unpleasantness of using the WebForms ViewEngine and the horrible flashbacks to my ASP days, I decided that I was going to do my best to avoid using it. I mean c'mon, its 2008, we've progressed beyond having to create spaghetti code and not have to resort to ASP.NET WebControls
I'm gonna go over a few of the things I really like about Spark that I've came across so far.
Application.spark
Spark uses a file called Applicartion.spark as the default master template.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
After a lot of fantastic discussions at this summers ALT.NET meet up, it became clear that I really need to start blogging. So after much delay, and screaming at FCKEditor to stop screwing up the HTML, I finally got SubText working the way I wanted it.. And maybe I've spent a little too much free time playing Spore
I really want to share the stuff I'm doing (I've fallen in love with exploiting Castle's AOP functionalities with Boo) and find out if I've headed down the wrong track. I would say the latter point is more likely, but I'm doing alot...