E
Edward Diener
In Borland's VCL it was possible to divide a component into design time and
run time DLLs. The design time DLL would only be necessary when the
programmer was setting a component's properties or events in the Object
Inspector, the equivalent to the VS .NET Windows form designer. The run-time
DLL would only contain the code necessary at run-time. The design time DLL
referenced the run-time DLL, but not vice-versa. This allowed the run-time
DLL only to be shipped to end-users of a module. The design time DLL was
only used by programmers who "designed" the component in their own code.
Why was this a good thing ? It was because the code pertaining to the RAD
design time system did not have to be included at run-time when the
component was executed, and therefore did not have to be shipped to
end-users as opposed to end-programmers. The run-time DLL was therefore
smaller and less bloated with unnecessary code.
It does not appear this is possible in .NET. I can still certainly divide my
component into two different assemblies, one for run-time code and one for
design-time code, which is what I would anyway as a matter of cleaner design
from my point of view. But it seems there are two reasons that I can not
make a clean division, such that both assemblies need to be available at
design time while the run-time assembly only needs to be available at
run-time.
The first reason is that the classes I use for my design time code, derived
from System.ComponentModel, do not necessarily only pertain to design time
functionality. According to the documentation on type converters, as an
example, they might apply both to design time and run-time.
Secondly to use the classes in my design time assembly at design time, I
must provide attributes for the types and properties to which the
design-time classes pertain and, if the attributes refer to classes in
another assembly, they must reference that other assembly. This effectively
ties my run-time assembly to these classes which I only want to use at
design time.
Has this issue been addressed or discussed anywhere ? It does seem to me
wasteful that .NET classes which I create only for design time functionality
needs to be distributed to the end-user by a programmer who uses my
component, even though the end-user will never need the functionality.
Furthermore I see no way to tell .NET that the classes which I create for
design-time functionality should only be used at design time and not
run-time.
Because of these issues, I have a feeling that there must be a way to create
a design time assembly for my component which does not have to be
unnecessarily shipped to end-users for run-time execution. Does anybody know
how to do this ?
run time DLLs. The design time DLL would only be necessary when the
programmer was setting a component's properties or events in the Object
Inspector, the equivalent to the VS .NET Windows form designer. The run-time
DLL would only contain the code necessary at run-time. The design time DLL
referenced the run-time DLL, but not vice-versa. This allowed the run-time
DLL only to be shipped to end-users of a module. The design time DLL was
only used by programmers who "designed" the component in their own code.
Why was this a good thing ? It was because the code pertaining to the RAD
design time system did not have to be included at run-time when the
component was executed, and therefore did not have to be shipped to
end-users as opposed to end-programmers. The run-time DLL was therefore
smaller and less bloated with unnecessary code.
It does not appear this is possible in .NET. I can still certainly divide my
component into two different assemblies, one for run-time code and one for
design-time code, which is what I would anyway as a matter of cleaner design
from my point of view. But it seems there are two reasons that I can not
make a clean division, such that both assemblies need to be available at
design time while the run-time assembly only needs to be available at
run-time.
The first reason is that the classes I use for my design time code, derived
from System.ComponentModel, do not necessarily only pertain to design time
functionality. According to the documentation on type converters, as an
example, they might apply both to design time and run-time.
Secondly to use the classes in my design time assembly at design time, I
must provide attributes for the types and properties to which the
design-time classes pertain and, if the attributes refer to classes in
another assembly, they must reference that other assembly. This effectively
ties my run-time assembly to these classes which I only want to use at
design time.
Has this issue been addressed or discussed anywhere ? It does seem to me
wasteful that .NET classes which I create only for design time functionality
needs to be distributed to the end-user by a programmer who uses my
component, even though the end-user will never need the functionality.
Furthermore I see no way to tell .NET that the classes which I create for
design-time functionality should only be used at design time and not
run-time.
Because of these issues, I have a feeling that there must be a way to create
a design time assembly for my component which does not have to be
unnecessarily shipped to end-users for run-time execution. Does anybody know
how to do this ?