Home All Groups Group Topic Archive Search About

Interface Design Question

Author
15 May 2006 2:40 PM
vikrantca
Hello,

I have an application that allows the user to customize one function
(literally only one function) by specifying a path to an assembly that
contains one class implementing an interface.

public interface ICorrelation
{
public double CalculateHTC(HTCInputs inputs);
}


At runtime, the program loads the assembly and gets a delegate to this
interface.

When the user installs the app, he/she creates a class by referencing one of
the application DLL's for the above interface.


My problem :

The above type i.e. the Interface and the class HTCInputs is not going to
change at all. But the version of the assembly containing the above types
changes every 3 month (development/release).
How can I ensure that the users dont have to recompile their code again and
again to that the new version of application can load the user assembly ?

thank you in advance.

Author
15 May 2006 3:45 PM
Vadym Stetsyak
Hello, vikrantca!

v> The above type i.e. the Interface and the class HTCInputs is not going
v> to change at all. But the version of the assembly containing the above
v> types changes every 3 month (development/release).
v> How can I ensure that the users dont have to recompile their code again
v> and again to that the new version of application can load the user
v> assembly ?

IMO you can separate parts that do not change into separate assembly, and user code will depend on that assembly. The other assembly ( which version changes ) will load user assembly without problems, because assemblies on which user assembly depends will not change...

Another way is to use Reflection with string based type names, however that may not be good idea since it will introduce perfomance overhead and complexity to design...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
15 May 2006 8:53 PM
David Browne
Show quote
"vikrantca" <vikran***@discussions.microsoft.com> wrote in message
news:287C40C8-FA56-4BDA-AC8F-A22EFA210821@microsoft.com...
> Hello,
>
> I have an application that allows the user to customize one function
> (literally only one function) by specifying a path to an assembly that
> contains one class implementing an interface.
>
> public interface ICorrelation
> {
> public double CalculateHTC(HTCInputs inputs);
> }
>
>
> At runtime, the program loads the assembly and gets a delegate to this
> interface.
>
> When the user installs the app, he/she creates a class by referencing one
> of
> the application DLL's for the above interface.
>
>
> My problem :
>
> The above type i.e. the Interface and the class HTCInputs is not going to
> change at all. But the version of the assembly containing the above types
> changes every 3 month (development/release).
> How can I ensure that the users dont have to recompile their code again
> and
> again to that the new version of application can load the user assembly ?
>


Don't change the AssemblyVersion.  Just change the AssembllyFileVersion.


David

AddThis Social Bookmark Button