The idea is good - put your code in a shared dll and refer to it. We use this method extensively and it works. Obviously, some projects will get out of sync eventually, the way we do it:
- Be the least specific if you can use generic types then do it. For example, if you want to use a function that processes NULLs or nothing, and
returns something, implementing NullConvert (o as an object, subst as an object), since an object is better than NullConvert (o as an object, String) as
Line. You can then add other types, leaving the signature intact. BUT, if the type is not processed, be specific within the method and make exceptions for the raw types - do not leave it accidentally that it works. In the above example, consider the return type and see if your implementation supports this type.
Group functions by type in a namespace; MyGeneric.DateFns, MyGeneric.StringFns, MyGeneric.Comms, etc.
Do not change functionality after using a class or method, and it may be unsafe. Mark them as deprecated and include comments to indicate where the new / best class was posted.
You can consider two or more libraries, for example, General methods and classes in the base library, as well as domain classes and
which use common methods (from the base library) in another library (at a higher level). Thus, the base library does not have to be constantly changing.
- Consider using "Implementations" instead of classes. If you have a function that processes an ArrayList, for example, set
parameter of your method instead of iList. Then you can use other types of lists if they implement iList inside them.
- Avoid introducing specific features, such as an explicit driver (Oracle 8.x). Wrap it with something else, so if it changes, change
the inside of the wrapper object, not the object itself.
- Learn how to use reflection. Let's say you need a function to get distinguishing values ββfrom an array of objects. You can use reflection and
then pass the name of the / s property you need to distinguish; GetDistinct (MyList as iList, "Name") as List (String). Your code may look
a parameter called "Name" through reflection (there is a slight performance limitation).
- Learn how to write extensions (component model). For example, if you write a function to always return formatted
include the function in the extension function. Call wisely, if your company name is ABC, then use ABCDateFormat, for example, to distinguish between your and MS functions, for example.
Too much needs to be done to be listed here. Your step in the right direction.