I’ve mostly been working in Visual FoxPro the past few weeks, sorting through the odds and ends of different projects to glean the best of the class libraries I’ve developed over the years. It’s an exciting time for me, because I have two projects starting from scratch, and both will use VFP 9.0. (I know. My life is unbelievably boring, but I like it that way.)
Most of my work has involved taking on legacy projects in unrelated business domains. These systems weren’t developed so much as accreted. I enjoy the challenge of extending and imposing at least some design on an existing system. Some of the projects have had parts in different versions of Fox from FoxPro to VFP, most have involved more than one developer, and none have used a commercial framework. (This explains my giddy delight upon discovering refactoring.) Interesting work, but it just plain hurts my brain to go from FoxPro 2.x to C# in a single day, or even a week, especially when the domains are different, too.
Therefore, I’m thrilled to have two brand spanking new projects. Over the years, I’ve developed some useful class libraries that I’d like to use in on these projects. The trouble is, the usefulness is scatter between 1/2 a dozen projects. So, it’s been a hair pulling exercise to recall where different features live and how best to integrate them into one place. Refactoring isn’t appropriate in this situation, although I did, at first, misuse it, by mixing it up with new development.
What’s all this got to do with multiple inheritance? I’d love to be able to create native interfaces in VFP. As marvelous as it is, there is no elegant way for several classes to inherit a common set of methods and properties. Worse, there is no clean way for code to know if an object implements some functionality. There are ways around the problem, but any solution is painful to some degree and requires cut-and-paste coding and reliance on an internal system convention–blech.
I try to follow the idea from Agile programming of coding what’s needed now, but coding flexibly for what may be needed later (my interpretation). That’s how I have useful functionality scattered throughout several projects. *sigh*
Thankfully, VFP has only a handful of native classes so systematically adding a common set of methods and properties to classes is relatively quick. So, back to ditch digging …perhaps soon I’ll be able to move on to building the lovely palace.