0

I develop client application that invokes product that has multiple versions and my customers can load different versions of the product one after another.

In order to support that in previous versions I created Application domain for each time user picked version.

Is it the right way to do it ? Do I have alternative ?

EDITED: Multiple versions - multiple dlls

Thank You!

Sergey Kucher
  • 4,140
  • 5
  • 29
  • 47

2 Answers2

2

If different versions of products reside in different DLLs, then yes, AppDomain is the right way to do it.

Although make sure you don't leak the DLLs to your main domain.

Also, run some tests to make sure you don't leak memory.

UPDATE

Alternative is to load the DLLs in another process and use RPC or service calls. I guess that's an overkill for your application.

Madushan
  • 6,977
  • 31
  • 79
0

I don't think the products has to reside in different AppDomains. What is the main reason for doing it that way? Do you want your app to be able to unload particular dll, and load a new version of the same dll while running? If not... I don't see what is the reason behind having App Domains.

AppDomains are usually used when you want to guarantee that memory allocated by assembly itself could be freed when assembly is unloaded. It makes sens in some types of apps. IIS uses AppDomains to manage all applications it is running (so that applications are separated).

Why not use a common interface for all versions of the product, and store information about the product itself inside (propert or whatever way you like)?

Maciek Talaska
  • 1,628
  • 1
  • 14
  • 22
  • The users must be able to change the whole set of dlls at runtime by changing to new product. – Sergey Kucher Aug 08 '12 at 08:02
  • But why it has to change the set of dlls? I don't understand it. I am pretty sure, that you could load all the object's definition at once, and depending on user choice - use only the one needed. – Maciek Talaska Aug 08 '12 at 08:22
  • Because the current version and the previous version represent value to a customer as well because the new version could be not an improvement but change of functionality for specific problem, user can play around between different versions to see the difference. – Sergey Kucher Aug 08 '12 at 08:41