Shared Class for Multiple Applications

  • Thread starter Thread starter Doug Kaufman
  • Start date Start date
D

Doug Kaufman

I have created a "business object" global class that will be used
across all of our applications. This class centralized all of our
common functions for easier management.

Here is my problem:
The class is mostly composed of shared (static) functions and subs.
The problem I encountered today was I needed to add another parameter
to our class that sends email messages, so I added a new optional
parameter to the function. After recompiling the dll (it resides in a
central location to all the web applications), each application
complained "Method not found" and described the function as it used to
be declared.

So my question is, what is the best way to define and implement a
global class which will allow mods to be made to its member functions
without breaking the applications that use this? I would have hoped
that because the new parameter was optional with a default value, that
the applications would have continued to work as normal?

Thanks in advance!
 
Since you changed the signature of the method you have borken the 'contract'
with all the consumers of your method. In such a case you have to recompile
the clients of your class.

Alternatively you can stick a ParamArray (or its equivalent in C#) at the
end of the parameter list. I would not personally recommend ParamArray
solution.
 
Back
Top