1. | What is a Class Diagram and why is it useful? |
|
2. | Explain how you can create custom properties and methods. |
|
3. | How can you add additional properties and methods to existing objects? |
|
Answers
1. | A class diagram is a diagram that shows the classes and their relationships and how they should be structured in your application. The complete class diagram model for your system is critical to create, as it provides you with a roadmap for what your code structure needs to look like. |
2. | Custom properties can be created using public variable declarations in a class module. Or, a preferred way is to implement public Property Get and Property Let procedures in the class module. Property Get procedures specify what should happen when the property value is retrieved. Property Let procedures specify what should happen when the property is assigned. Custom methods can be created by adding public procedures or functions to the class module. |
3. | You can add additional properties and methods to existing objects in the same way that you create your own properties and methods for your own objects. The only difference is that you place the code in the class module for the existing object, such as a form. |