Legacy

JAOO: Working Effectively with Legacy Code 2 – Michael Feathers

I have a tremendous amount of respect to Michael Feathers, so it is a no brainer to see his presentation. Michael is talking about why Global Variables are not evil. We already have global state in the application, removing it is bad/impossible. Avoiding global variables leads to very deep argument passing chains, where something needs an object and it passed through dozens of objects that just pass it down. We already have the notions on how to test systems using globals (Singletons). He also talks about Repository Hubs & Factory Hubs – which provide the scope for the...

posted @ Monday, October 05, 2009 11:39 AM | Feedback (6)

3rd party integration assumption - other system was written by a drunken monkey typing with his feet

If you have heard me speak, you are probably are aware that I tend to use this analogy a lot. Any 3rd party system that I have to integrate with was written by a drunken monkey typing with his feet. So far, I am sad to say, that assumption has been quite accurate over a large range of projects. You are probably already familiar with concepts of System Boundary and Anti Corruption Layer and how to apply them in order to keep the crazy monkey shtick away from your system, so I am not going to talk...

posted @ Sunday, March 22, 2009 2:57 PM | Feedback (10)

Challange: The sample legacy database from hell

I need a legacy database for my NHibernate course. I can take some of the creepy ones in the NHibernate test suite, but I think that would be evil to the students. Anyone can come up with a good (um, bad) legacy database that is also small enough to be a good example?

posted @ Wednesday, February 18, 2009 8:41 AM | Feedback (16)

Field Expedients, or why "I don't have the tools" is not an acceptable answer

Recently I had a few conversations about tooling, lack thereof and the impact that this has on the overall system. I don’t think that someone can argue that starting from scratch is a very good idea in most scenarios. This is especially true when you are talking about any significantly complicate system, which we all do. There is still a place for quick & dirty solutions, but that is for throwaway utilities. Hell, even calc.exe isn’t simple (arbitrary precision numbers) anymore. Therefore, I am constantly surprise by people that chose to go without. I could understand that if they chose that path out...

posted @ Tuesday, March 11, 2008 7:43 AM | Feedback (17)

Dealing with legacy code

Roy is talking about legacy code, and has some great tips about it. I would like to re-iterate the recommendation for TypeMock for legacy code. I still think that it is preferred to limit TypeMock to legacy code, but that is another issue. There is another approach that I would like to mention, which is fairly radical and takes a while. Break The Code. You can do a lot with R# just blindingly doing Extract Method (Ctrl+Alt+M). At one point I had a classs with: CommandHandler.Run_Maybe_ParameterValidation() CommandHandler.Run_SecondPart() CommandHandler.Run_WhyDoWeCallTheWebServiceHere() CommandHandler.Run_UnnecessaryThreadingCode_WTF() Those were an intermediatery state, just to allow me to...

posted @ Monday, June 11, 2007 1:04 AM | Feedback (0)

Handling Legacy Data using OR/M

Patrik has a good post describing how to handle legacy database with an OR/M. I have used similar techniques to map a basically flat file database to a nice relational view, and from there to a workable domain model that make work much easier (Say: Policy and Insurance vs. AF_432 and GF_2345).

posted @ Thursday, June 07, 2007 12:59 AM | Feedback (0)

NHibernate Generics: Deprecated On 1.2

I have updated NHibernate Generics to support NHibernate 1.2 . This update is very minimal and was done to ensure that you can move code to the NHibernate 1.2 without breaking stuff. Please consider NHibernate Generics library use as deprecated with NHibernate 1.2 and above. NHibernate Generics (NG from now on) always had two purposes. The first was to give generics capabilities to NHibernate, so I wouldn't have to do casts all over the place. The second was to automatically handle assoications between objects using anonymous delegates and a sprinkle...

posted @ Monday, October 16, 2006 8:15 PM | Feedback (0)

The Joy Of Legacy

Things I discovered today about the legacy project I am working on: If you say the method names with a french accent, they actually sound meaningful. If you keep this up for long enough, you might make a song out of it. I don't think it will be a top 10 hit, though. There are several crucial differences between the "DO_CR_DA" and "DO_DA_CR", although both are called from the same place and looks nearly the same. It doesn't matter how long it takes the code to run, you can keep yourself busy for days, trying to gues what the method names...

posted @ Sunday, April 09, 2006 2:39 PM | Feedback (0)

My Daily WTF

The term "churning code" has no direct equivalent in Hebrew, sadly. I did a code churn of ~12,000 Lines of code a couple of weeks ago, and I got some... peculiar results. I recently got a call from a co-worker about a piece of code that I wrote during this churn. The code was something like: SELECT ...

posted @ Friday, March 10, 2006 6:48 PM | Feedback (0)

Put down that cursor and step away from the database, Mister!

I'm seeing too much cursors around right now. Way too many. I also keep seeing the same code over & over again. I know that I'm in trouble because to work with this code base I need to:constantly use grep (and deriatives, like AstroGrep, which is cool);get a diff program that support drag & drop from the shell as well as quickly changing only one of the files. (Found WinMerge, which looks cool);pronounce variable names out loud in order to understand their meaning*;watch ingenious workarounds to all sorts of limitations in the number of concurrent nested corsurs in the database;cut...

posted @ Thursday, January 19, 2006 7:43 AM | Feedback (1)