Circular References No More

I solved the issue I had with my circular references. I used Anakrino to reverse engineer the System.Data assembly, and I determined That MS puts their SqlServer classes in the same assembly as the base data classes, so it's not really the end of the world if I have a few default providers in with the main engine classes.

I did however, run into a problem that I subsequently solved. The problem was that I had tied the OutputProvider logic too heavily into the engine. The engine had way too much information about the MIME types and file extensions for our embedded Providers. This meant that an external Provider would not function, because the engine had no clue what file extension to use, or how to instruct the browser of it's contents.

I solved this problem by modifying the IOutputProvider interface to have 2 readonly properties. These properties would have to be implemented by the providers and, would hold static strings with the required file information. That information would be specific to that provider, and not tied inside the engine itself. I then was able to eliminate to classes full of constants, and 3 helper functions. Net code change: -45 lines.

In solving this problem, tho, I created a new problem for myself. My OutputProviderFactory used the basic HTML Output Provider to handle the formatting for nearly all of the embedded document formats. So, if I modified the IOutputProvider interface to hold that property, I would be unable to specify multiple mime types and file extensions for a single provider. I thought I was right back where I started again in terms of duplicating code.

I agonized about it all day. I don't let problems go unsolved, and I won't give up until I have an answer, no matter what the cost. Finally, around 2pm, the answer came to me. My existing architecture already made the solution ridiculously simple. All I had to do was inherit from the base HtmlOutputProvider, override the properties with new values, and that was it. I didn't even have to override the base implementation, because I would not be modifying it in any way. The architecture we implemented is truly fabulous.

So that was my condrum for the day. Problem solved, and GenX.NET is now an even better component. I'll be finalizing the codebase and comments today, and Sunday will be licensing, users guide, and the installer. We should be on track for a Monday evening launch.

No Comments