Items of a ComboBox are getting pulled from some DB cache,etc.. This ComboBox has been used in one assembly and so there is the code for it in that assembly on how to load data. Now in a second assembly again I have the same combobox and again should be filled with the same items, so the code that loads items for this combobox is the same.
Now: I can either just copy paste that Load method in my new assembly OR I can add a reference to that assembly and create an instance of the class that this method is in it and then call that method. ( its methods are not static in that class)
Which approach do you suggest?
If both assemblies are still in use (i.e. subject to later changes), then obviously the import + use the same class. If that method ever needs changing you need to do it in two places. It’s a maintenance nightmare.
If the other assembly is “abandoned” (will never be changed again), I guess you could get away with just copying the code.