Data Wrappers

Our application is broken up into Dynamic Link Libraries for modularity. Not sure if that really gains us anything. It does make it harder to make calls across the DLLs. You got to create entry points that can be called. I found myself doing this in my most recent tasks. Two DLLs needed the same functionality. No reason to duplicate code. I put it in one DLL, and exposed it to the other.

Now I found all the information I needed to pass across DLLs. These natrually became paramters to the interface function. This is a C language interface. So I made sure the types were known to C. All good right? Well I looked around and found the other DLL entry points wrapped all the paramters up into a structure.

I guess this is some kind of object oriented C. But what is the benefit? You pass a pointer to a structure. Then the code that gets called needs to dig into that structure to extract the paramters. I don't think we are gaining much here. Sometimes you have to ask yourself why?