Lorenz Cuno Klopfenstein

Posts tagged "Babil"

I have been implementing a simple and easy to use IoC library: I need a simple solution and big frameworks like Spring.net offer way too much stuff (even Autofac is getting huge). My implementation is composed of some basic container, some simple instantiation logic and some stuff to do automatic property injection. Nothing more.

In order to keep a collection of all singleton instances registered in the IoC container, I needed a thread safe dictionary implementation. There are a lot of discussions about how to do it right: the agreed point is that it isn't simple, mainly because you're working at the wrong level of abstraction.

Either you get a lock on each single IDictonary method, that would result in tons of locking with potentially incoherent results between one call and the other. Or you expose a more complex interface, like they did with ASP.NET MVC's RouteTable collection, and leave locking to the user.

I decided to do something in between, using ReaderWriterLockSlim from .NET 3.5 instead of a simple lock{} and writing a fine grained IDictionary implementation while also exposing some high level methods to obtain coherent and really thread safe results.

More...

Posted on Friday, December 18, 2009
Tagged as
3532 Views
554 comments posted

I recently updated the source code to my Babil project in order to port it to the new ASP.NET MVC 2 beta. I decided I could as well update all other libraries the project depends on, which have been updated too in the meantime.

This took some time, but if you want to create a new website project based on ASP.NET MVC and NHibernate, here's the latest bits:

  • Get the ASP.NET MVC 2 beta source code from Codeplex and compile it. Remember to also compile the Microsoft.Web.Mvc.dll library that contains some useful code.
  • Get NHibernate 2.1, the latest release of the popular O/RM library.
  • Get the latest MySQL .NET connector (6.1.3) if you use NHibernate against a MySQL database.
  • If you use NHibernate.Search for full text indexing:
  • If you use NHibernate.Validator, get the source code and compile that too against the latest NHibernate DLL.
  • For your dependency injection needs, you might use Autofac. In that case, you also need to download the latest stable Autofac library and the source code of the web integration library. This integration library must be compiled using the beta version of ASP.NET MVC 2.

That's it, now throw everything in the /Bin folder and - crossing fingers - you should be able to finally write some own code.  :)

Posted on Wednesday, December 16, 2009
660 Views
3 comments posted

ASP.NET MVC logo Today I wanted to add server-side caching to Babil. I had already read different opinions and techniques to do it and one in particular was interesting: it was something like "of what use is caching if the only thing the server ever does is concatenating some strings and fetch data right out of the ASP.NET cache" (as is the case using NHibernate's second level cache). Since I have no idea, the only way to find out, as usual, is to measure.  :)

Turns out that generating a complex page takes almost as long as 200ms, while returning the same page stored inside the cache takes at most 10ms (these are the values I get on the ASP.NET server included with Visual Web Developer, I expect Babil to perform much better running on a real server and not with a debug build of course). Anyway, the difference is quite noticeable and convinced me to try and get output caching done.

More...

Posted on Thursday, January 15, 2009
Tagged as
2234 Views
19 comments posted

Gothic Italia header

Yesterday the people at Gothic Italia (the italian community dedicated to the "Gothic" videogame saga) launched their brand new homepage GothicItalia.it, developed by me.

Apart from design and contents (which may or may not interest you... the original "Gothic" can be bought on Good Old Games if you want... and it's a great game!  ;)), the website is powered by the same CMS I worked on for this personal site. It's built on top of ASP.NET MVC, uses NHibernate as O/RM and Lucene.NET for full-text indexing. Having to use the same system for two different websites encouraged me to try making it modular and customizable: as for now, the CMS is still far from being easy to work with and flexible enough, but as soon as I add some more things I will release the code and make it a "real" free CMS product.

The CMS will be called "Babil" (as in Babilonia), because it has been built to support multiple languages from its roots. Every single content item can be published in one or more languages and users can freely switch from one to the other. The target is to build a simple multi-lingual, multi-user and multi-section system with several extension points.

Posted on Monday, January 12, 2009
Tagged as
371 Views
1 comments posted
Back to Klopfenstein.net
Clemens Klopfenstein Serena Kiefer Lukas Tiberio Klopfenstein Lorenz Cuno Klopfenstein
English German