Thursday, November 5, 2009

Linq and MySql Coolness


I have been messing around with this cool framework called IQToolkit. I was able to get some simple CRUD running against MySql pretty quickly. The code is database independent so you can change the App.Config to say SQLLite without any code changes and it just works.



It is short on simple samples so here is what I threw together playing around. You can get the code here.

Saturday, June 27, 2009

Simple .Net Rules Engine

I just posted the start of a project on google code. It is posted under the New BSD Licence. If anyone is interested in contributing send me an email. The code is http://code.google.com/p/simple-rules/

Snippet...

Employee.Rules
.Add( "Terminate all hourly employees" )
.When( Employee.is_hourly )
.And( Employee.is_active )
.Then( Employee.terminate );

Monday, March 23, 2009

Free ASP.NET MVC eBook Tutorial for download.

Download

I just downloaded, haven't read. At glance I see unit tests too.

Saturday, February 14, 2009

LINQ To SQL Automapping

I had tried to use LinqToSql before on a project and found that is was pretty cumbersome. I do still try to learn as much as possible concerning this topic when I can given I normally use NHibernate and am pretty happy with it. I get tired of all of this extra crap I have to do... Doesn't matter which framework I am using.

So I was messing around this evening (working on a small sql scripting utility) when I realized you can query from SqlServer using LinqToSql and Poco's and no presupplied mapping information. You just create a data context, connect to the database, build your poco and tell the datacontext to get you some data for the given object. It automatically takes care of the mapping for you.

I was pleasantly surprised when I realized this. Though I have not tried to do any inserts or updates as of yet, using the data context in this way, it does work great for queries. I am querying the information schema views from SqlServer to load database information for scripting operations and it is a breeze.

Now the hard part. How to turn these table objects into something that I can load the actual table data into... Reflection Emit anyone?

Suggestions would be great...

Tuesday, November 18, 2008

Typing skills

I've said in the past that my most valuable high school class was typing. It looks like Jeff Atwood would agree. And I agree with him that programmers should strive to be efficient typists.

But I won't go so far as to agree that "coding is just typing", even jokingly. Too many people believe that programming is a mechanical process, and we can't reinforce that mistaken belief. Coding is hard, typing isn't.

UPDATE: Check out Jimmy Bogard's thoughts on this: "We’re thinkers first, coders second." Yes.

Friday, November 14, 2008

Kanban in a Small Team

A couple of us (myself included) recently had the opportunity to attend KaizenConf. It was, in a word, amazing. We brought back a whole lot of stuff from the conference, but the one thing that has had the most impact in the shortest amount of time is our adoption of Kanban.

We had been noticing that at the start and end of our iterations, we'd be a little slow, either getting started or wrapping up and not wanting to start anything new on a Friday. Kanban completely eliminates that and does a whole lot more. The concept of pulling from the "done" side of the board instead of pushing from the backlog of work has really turned our process around. It takes a different way of thinking from what we're all used to, but everyone has adapted really quickly. Everything seems to be more smooth and natural as we switch between tasks. Maybe it's just excitement or the newness of it all, but throughput seems to have increased as well.

We're still working out a few things - the limit of stories per category, how big to make the stories, things like that. It's all to be expected though. We're taking the advice of everyone at the conference and starting small with a pretty simple board and testing the waters. Everyone seems to love it though, and we all constantly have new ideas. I'd definitely recommend trying this out if everyone on your team is willing to give it a shot.

Here's a link to the KaizenConf wiki page from the open session on Kanban in Smal Teams. Be sure to check it out if you're interested in Kanban.

Wednesday, November 12, 2008

SharePoint 2007, MOSS, WSS3.0

Today successfully deployed our applications to test environment and working as expected without any issues.

Migrated about 800K documents from HummingBird system to SharePoint2007.

Developed custom Webservices in SharePoint using SharePoint API and TDD it in VisualStudio2008.

Used CAML queries for searching through managed properties. Awesome fast. Used U2U
CAML builder tool to build CAML queries (they are little complex to write).

Learned SharePoint2007 Administration and configuration.

and lot more.

Thursday, June 19, 2008

NHibernate mappings

Jeremy Miller has posted about how to verify your NHibernate mappings using the slick PersistenceSpecification class, and how you can replace your xml mapping files with code using ClassMap.

Our group is a bunch of NHibernate noobs, so I'm sure we're not using the best methods. We test our methods with simple integration tests. For example, to test that we can load an entity from the database, we'll:
  1. Create the entity.

  2. Create a stand-alone NHibernate session.

  3. Use that session to save the entity.

  4. Reset the session factory.

  5. Get an instance of the entity's repository.

  6. Query the entity using the repository.

  7. Run a bunch of asserts to verify the properties on the loaded entity match the properties of the original entity.
This does a fine job of catching any mapping problems, but the tests are kind of long. So I find Jeremy's method quite compelling.

Wednesday, June 18, 2008

Windsor's Logging Facility

Casey Charlton has a nice post on using Windsor's Logging Facility. My only question, though, is why would setting the logger through a public property be superior to setting it through a constructor?

Here, we just have our own static class in our framework library called Log that wraps log4net. This saves us from messing with dependency injection - all your class has to do is call Log.Debug("whatever").

Friday, May 30, 2008

Be the grease

There's a good article on InfoQ about handling interruptions. Perhaps one of the team members needs to be dedicated to handling these things:
On similar lines Gojko Adzic, added his part of the story when he was working as an architect on a project but spent most of his time on working as a software lubricant. Being a lubricant included tasks like answering questions to new people, coordinating various threads, interfacing with clients and attending all sorts meetings. Gojko added, when he tried to be productive on the programming related tasks a lot of other team members had to act as lubricants and this was pulling the team velocity down. This is when he decided to take all the secondary work with him and let all other members on the team focus on primary tasks.
That describes what I do pretty well. I spend most of time in meetings, handling issues, documenting stuff, etc., so that the rest of the team can focus on writing code. Any time I actually get to spend writing production code is gravy. (Well, from my perspective it's gravy. The rest of the team probably thinks, "Oh, $#@%! The boss is in the code again!")

We do have one person on our team besides me that handles the bulk of the support for legacy applications because he's a massive knowledge silo when it comes to them. It seems to comes in spurts. He may go weeks without dealing with any of these old apps, and then there will be a bad week where he spends more time on support than anything else. We need to fix that.

Tuesday, May 20, 2008

Serializing DateTime issue

I ran into an issue today while working on a testing utility that submits transactions to a web service. That transaction contains a couple of DateTime values, and they weren't showing up at the web service with time zone information. For example, the utility was sending this:

<time>2008-05-18T14:00:00</time>

But time zone is important to the web service. It needs this:

<time>2008-05-18T14:00:00-05:00</time>

The way to fix this is to add the following underneath the <configuration> section in the client's app.config file:

<system.xml.serialization>
  <dateTimeSerialization mode="Local"/>
</system.xml.serialization>


Interestingly, I've written similar utilities using Visual Studio 2005 and .NET Framework 2.0 and this wasn't an issue. I didn't have to include any special configuration to get the time zone offset to show up - it just did.

However, I used Visual Studio 2008 and WCF today, and the time zone offset disappeared. Nice one.

Wednesday, May 14, 2008

Links on May 14, 2008

Casey Charlton reminds us about some of the fundamentals of agile development and the Time-Quality-Functionality triangle. I would substitute "scope" for "functionality", if only because I'm a lazy typist.

Davy Brion shows us how to set a time out on a lock. Like Davy, our whole team is reading Release It! right now. We don't build systems nearly as large as described in the book, but we're still finding some great tips in there.

Friday, May 9, 2008

It's the little things

Raganwald links to this post by Tony Stubblebine on improvement:
The idea is that how good (or expert) you become at a skill has a lot more to do with how you go about doing your work than it has to do with merely performing the skill a large number of times or over a long length of time. An expert will break down the skills that are required to be expert and focus on improving those skills either during practice (sports) or during the course of day-to-day activities (business).
RTWT.

Friday, April 18, 2008

Prioritization

Tim Ottinger has three short posts about setting up a "funnel" to prioritize the team's work.

Part 1

Part 2

Part 3

Part 3 gets into Stephen Covey's methods of breaking down work by what is important and what is urgent. This post helped clarify the difference for me.