1.1 Never hard-code application-specific or component-specific values in object templates.

Object templates should be made as generic as possible. Because you can rarely know in advance the project in which the objects might end up, you have to design your objects accordingly. There are essentially three mechanisms you can use to ensure that the data used and displayed by a template object is the proper data for the project in which the object resides. You can

  • Reference the Assembly object of the .NET Framework to obtain application-specific data, such as calling System.Reflection.Assembly.GetExecutingAssembly.Location to obtain the path and filename of the application.

  • Provide functions and properties that the host project can ...

Get Practical Standards for Microsoft® Visual Basic® .NET, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.