woensdag 30 april 2008

NHibernate here we come !

Currently we are starting up a project to rewrite the security service.  The previous version was build using data sets (argh it even gives me the creeps just writing this word), relying heavily on the database.  For every change (big or small) on the user profile the entire thing was deleted out of the database and the new version was inserted.  It even came this far that with large profiles, the timeout of the web service was hit and the application refused to work altogether.  Lessons learned from this debacle, we decided to build a clean domain model and use a UnitOfWork to decide what needs to be saved into the database.  We added features like lazy loading and caching as well to avoid database payloads.  Then we decided, based on the patterns already examined, we would need an ORM.  We looked at some possibilities (Allors, NHibernate, ...) , did some spikes and decided that when building a Persistence Ignorant domain model, Nhibernate was the best choice.

We presented our findings and spike results along with our proposed solution to the enterprise architects.  It was turned down for no apparent reason.  Their solution was to align with the rest of the organization and go for a data-driven approach (they even mentioned data sets) and thus avoid complex domains that need mapping through a tool.  In case of caching, we were told to write it in stored procedures (because that is why they are there for :-)).  "Why on earth did we even have a complex domain model" was the last question of the meeting.  This coming from a team  that believes that writing unit tests is more time consuming than it is beneficial.  Wait until they have to maintain one of these data-driven applications :-). 

We lost this battle, but we didn't surrender our fight.  We already assembled some followers:

  • The DBA team loved the caching and the reduced database hits.
  • Other development teams were experiencing the same problems so were asking for similar solutions. 

Long story short, the decision to use it or not was postponed until a meeting were both us and the A-Team would present our cases.  The meeting was last Monday and given this blog posts title our arguments have won it.

Thank God because we already started on the ground work of our own ORM and it would take a lot of work to build the features we are now getting for free!  We've worked about two weeks on it and I think we could cover about 75% percent of our basic CRUD operations.  We didn't yet added support for collections the UnitOfWork, but we already had ideas about how to do it (build a custom persistent collection for it).  Our implementation depended heavily on the dynamic proxy of castle project and was inspired by the NHibernate source code.  Writing it ourselves made me think about this scene from the matrix were Morpheus asked Neo to take the blue pill and stay ignorant (about persistence issues) or take the red pill and see what really going on.  We were forced to take the red pill or doom the project before it even began.  It was fun to experiment with it, but when your problem domain is security, that should be the focus of your development all time you spent on infrastructure code is time wasted!

Anyway we are going to test NHibernate in our project, then it will be evaluated and eventually rolled out to the rest of the development teams. Lets start reading about it!

See ya next time.

Tags van Technorati: ,

zondag 27 april 2008

Methodology

I am a big fan of agile methodologies.  In my opinion they are the only way one can guarantee (can you ever??) the delivery of the project.

Benefits of agile development are already widely known by the developers.  But the persons who control the budget usually are not aware about these.  So here is a short list in case you have to convince them :-)

  • Improved return on investment (RIO)
  • Early detection and cancellation of failing products
  • Higher quality software
  • Improved control of a project
  • Reduced dependence on individuals and increased flexibility

One of the cornerstones of my development process is automatic testing.  Writing your tests in advance (Test Driven Development) is better because then every feature you put into production code is checked by automatic tests.  I must say I violate the principle of writing tests first occasionally, but all my code must be covered before I can ship it.

At my current job we are working according to the Scrum methodology. The organization has a more 'analysis first' belief therefor we cannot completely follow the Scrum principles.  But time is changing.... hopefully!! 

Tags van Technorati: ,,

zaterdag 26 april 2008

My open source project

As outlined in my previous post, I am working on Allors in my spare time.  This project enables you to focus on your problem domain instead of most infrastructure code.  It is not exactly an ORM mapper because is does not do mapping for you. If you decide the persistence layer should be a database, that database scheme is created for.  It uses different strategies to 'save' your object with the active record principle.

In the following series of posts I will be building an Accounting program to track my customers and my contracts with them.  I could then enter my timesheets and generate my invoices directly from them. 

The main idea about the series is to show how easy you can model your domain and demonstrate the strong points of our framework.

Stick with me or subscribe to my feed at: http://feeds.feedburner.com/ComeTalkAWalkWithMe

Tags van Technorati: ,

Getting Started

A couple of weeks ago I decided that I should get a blog.  Why one might ask, why do we need another blog in this world?  The answer is fairly simple, I need a blog as a reference for myself.  I need a blog to improve my writing skills and I need a blog because Jan told me (just kidding of course).

If you care to know me more personally I invite you to read my profile. professionally I am developing software ever since the millennium bug.  I started out at Capco, doing consultancy work in Java across Europe (Antwerp, London, Frankfurt, Luxemburg).  I then switched to MSP and .Net.  For them I became the lead developer/architect on a major insurance project in Eindhoven.  In 2004 I decided to take a leap into the dark.  I quit my job and started my own company (PDBC-Systems).

Currently I have a contract at SD WORX (signed thank to Inxin) where I am working on the new security component.  It is built using .NET 3.0 exposing a WCF service on the back-end and a WPF application on the client-side.  My blog will probably be filled with anecdotes about this project.

In my spare time I participate on an Open-Source project called Allors.  Allors is a domain driven enabler!  You create a meta domain by using the repository browser, afterwards Stringtemplate takes care of the code generation to build your domain objects.  By using different strategies (memory, SQL, oracle, ...) you can map your domain to different persistence methods.  A fair amount of blog posts will probably be Allors inspired.