October 2004 - Posts

Slides from my “Chubby Client” presentation

I’ve just published the slide deck from my ”Chubby Client” presentation held at the NNUG meeting in Oslo yesterday. The deck can be viewed here. Thanks to all the people who showed up – I had a great time presenting and I hope you enjoyed my presentation.

Try doing this with SQL!

While researching for an in depth article about NHibernate I discovered a cool feature in the Hibernate Query Language (HQL). Because the framework supports polymorphism, you can retrieve every single persisted entity in the database with one simple query:


1Configuration cfg=new Configuration();
2ISessionFactory factory=cfg.BuildSessionFactory();
3ISession session=factory.OpenSession();
4IList objects=session.Find("FROM System.Object");

After running this code snippet, the list will include every single entity in the database casted to System.Object. This might not look particularly useful in real-life scenarios, but what if you exchange System.Object with the name of a base type in your class hierarchy? This would enable you to retrieve all varieties of an object with one single query.
Using System.Object in queries also very handy when working with test data. I use NHibernate to populate the database with data in the SetUp handler in my NUnit tests and then I clean up after myself in the TearDown handler by deleting all entities from the database. Like this:

1session.Delete(“FROM System.Object”);

Now try doing that with SQL!

It’s awfully quiet around here

It’s been rather quiet on my blog this month; the reason is that I’m incredibly busy at the moment. I’m currently doing an e-business solution for a large Scandinavian retailer. I’ve already done three presentations this month (One on Application Blocks, one on Unit Testing and one on Refactoring).
Additionally I’m working on presentations on Visual Studio 2005 Team System and MSF Agile for a “future .NET technologies boot camp” later this month. I will also be doing a “Chubby Clients” presentation on the Norwegian .NET User Group (NNUG) meeting later this month. And I’m writing an article about NHibernate. Look forward to lots of bits and pieces from all of the above appearing on my blog in the weeks to come.

Spring.net RC1 released

A release candidate for the .NET port of the popular J2EE Spring framework  was released today.
The release includes the IoC container which is central in the Java version of the framework.
Some functional highlights:

  • Constructor and Setter based Dependency Injection
  • Factory method creation
  • Inheritance of object definitions
  • Support for .NET application configuration files
  • Event wiring
  • Auto wiring of collaborators
  • Singleton/Prototype creation modes

The aspect orientation support found in the Java version is not yet part of the .NET port, but I know that the project has started work on this and we should expect a release with AOP support in the near future.
[Updated: After playing around with the release candidate I discovered that AOP infact is included in the code base - its just not official.]

The framework is available for download at http://www.springframework.net/ along with documentation and example code.

Spring is a very interesting framework which, along with other light-weight frameworks such as Hibernate, has given the Java community an entirely different approach to application development from the classic EJB architecture.
I’m glad to see a .NET port of this framework. Expect to see more thorough coverage of it on my blog soon.

Respect is due for Mark Pollack and the rest of the Spring.NET team. Keep up the good work!