Welcome to Manicprogrammer Sign in | Join | Help

Project WOM - WorkItem-Object Mapper

Project WOM just got it´s first release!

It´s a huge landmark in the project since this is the release that showed that IT´S POSSIBLE to build a type-safe layer on top of the WorkItem store.

As I know that most of my readers (are you there? say hello? Someone there? :( ) are developers, I´ll show some code so you can see how cool this project is!

Obtaining a workitem of WorkItemType "Task" from CodePlex (the Id for the WorkItem is 3218):

   1:  Task t = new Task(3218)

WoW?!? That´s just it? You gotta be kidding me! No, I´m not young padawan! Now it´s as easy as that to obtain a Task. What? You want to save a new bug with High Priority and assign it to Master Yoda? Ok, let´s do it!

   1:  BugManager bMan = new BugManager();   
   2:  bMan.BeginTransaction();   
   3:  try{
   4:    Bug b = new Bug();
   5:    b.Priority = Priorities.High;
   6:    b.Status = Status.Active;
   7:    b.AssignedTo = "MasterYoda_cp";
   8:    bMan.Save(b);
   9:    bMan.Commit(); //Only here the Bug is really saved.
  10:  }  
  11:  catch{  
  12:    bMan.Rollback();
  13:    throw;
  14:  }

WOOOOOOT? Transaction support? I didn´t know that was possible!!! Calm down my dear friend, it isn´t. This is an emulated transaction, as in: when you do the last commit, it flushes all changes to the WorkItemStore. But I´m working on making it undo changes to the WorkItemStore in case of failure.

Hmmm... Master Yoda´s not happy about the bug #3440 we just assigned to him. So let´s change it to Anakin Skywalker:

   1:  BugManager bMan = new BugManager();   
   2:  bMan.BeginTransaction();   
   3:  try{
   4:    Bug b = new Bug(3440);
   5:    b.AssignedTo = "AnakinSkywalker_cp";
   6:    bMan.Save(b);
   7:    bMan.Commit(); //Only here the Bug is really saved.
   8:  }  
   9:  catch{  
  10:    bMan.Rollback();
  11:    throw;
  12:  }

Ok, so you are trying to convince me that the FAKE code above actually works?

No my friend, I don´t want to convince you. I want you to go to the project wiki and take a look at the project, so you can help out this young padawan here improve it in ways never before imagined!

Now seriously friends, please help me out with some feedback, so I can improve this great tool. I know for sure that it´s helping me a LOT in Project BHAL.

I´m waiting on your suggestions!

Site Meter
Published Sunday, September 24, 2006 2:44 AM by heynemann

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments


Enter the text you see in the image:

Leave a Comment

(required) 
required 
(required)