I’m developing a Windows Mobile 5.0 or above application with .Net Compact Framework 2.0 SP2 and C#.
I have to libraries: one to access SQL Server CE and the other with Custom Controls.
When I retrieve data from SQL Server I use structs to return them. These structs are defined on library one.
My problem is that these data is used with some Custom Controls on library 2. How can I fix?
- Referencing library1 on library2. I
can do that but library1 is specific
to this project and library2 can be
used and must be used in another
projects that don’t use library1. - Creating another library to store this structs?
- ??
What do you think?
Let’s simplify:
There are two options:
a) Extract an interface.
Some controls in Library2 use Library1 directly. You can modify those controls to use an interface and not the Library1 implementation of that interface. Put the interface in Library3. Now you have:
b) Extract common implementation
Some controls in Library2 use Library1 directly. You can extract those data structs from Library1 into Library3. Now you have a situation similar to above.