ORMs

Yesterday I was thinking about how complicated and painfull is accessing databases in .NET, and thus in WPF. It is absolute mess. Really. Much more messy that it was in good old ADO (anyone remembers those times?), and not even remotely close to data access nirvana of FoxPro and Visual FoxPro.

LINQ is very nice, but it is just a query language completely missing insert, update, and delete concepts. Then there is a weird thing called LINQ to SQL – it really sucks if you are changing database schemas (and you normally do that in the beginning of the progect frequently). Sheer amount of the code and “infrastructure” generated for you is mindboggling. Things get even worse if you want to use SQL Server CE – then you are stuck with something called SqlMetal. Brrrrrrr! Then, add plain old ADO.NET with LINQ to ADO, and EF to the “package” and you are completely and thoroughly lost. Bad… very bad… total mess… Does it have to be like that? And why Microsoft cannot decide on one thing and do it right?

That’s why I decided to spend some time and to see if there are any alternative ORMs available.

Everyone knows NHibernate (little brother of Hibernate), and DevExpress’ eXpress Persistent Objects (as one friend of mine said, “When I hear word DevExpress I am reaching for my gun!” :). These two ORM frameworks are suffering from the same problems as EF, LINQ to SQL and other things offered in this domain by Microsoft: too general, too complex, too steep learning curve, too many demands and expectations toward the code developed. They might be good for big and complex systems, but if you develop an application where database is just one small part of functionality they quickly become too big of a burden.

Clearly, there is a need for something more lightweight. And seems that I found something that looks rather promising: one thing is called Mindscape‘s LightSpeed, and the other one has intriguing name LLBLGen Pro. Both frameworks look really easy – I got pretty much of the LightSpeed’s idea in about 20 minutes, although have not checked LLBLGen Pro yet. Both are offering most essential features – as Mindscape says, “Solve the 95% case, i.e. more like Ruby on Rails than NHibernate”. Both provide Visual Studio integration. LLBLGen Pro supports more databases than LightSpeed, but both seem to be OK for our needs. Probably they are not as flexible and not as all-encompassing as their “older brothers”, but it is obvious that not everyone needs this flexibility anyway – I think “less is more” is very frequently true. Both frameworks fully support LINQ as well as INotify* interfaces, so they can work in WPF.

Personally I liked LightSpeed’s web-site and documentation more, but probably LLBLGen Pro has appropriate content as well. Cost wise they are not that bad, and LightSpeed exists in free version as well (with limit of 8 tables).

googletest: Another C++ Testing Framework

Just few days ago I found WinUnit, and voilaz – here is googletest, Google’s xUnit-based multiplatform framework for writing C++ tests. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation.

Software Testing and Related Things

By accident found Google Testing Blog. Not bad.

One of the articles is called How to Write 3v1L, Untestable Code – a must-read for newbie (and not newbie too!) programmers. Not on this blog, but nevertheless related article is How To Write Unmaintainable Code by Roedy Green – very serious collection of bad things despite it is very funny to read.