Summary


In this chapter, you learned how to create a Class Diagram to model the classes and their relationships. Class diagrams provide a roadmap of your code structure. Ideally, Class Diagrams should be separated into a presentation layer, business logic layer, and data access layer. The presentation layer can map to your Use Case Diagrams. The business logic layer is the heart of your Class Diagram and contains the class modules that are the heart of your application. The business logic layer calls the data access layer for any activities that need communication with the database.

You then looked at several examples of how to create properties, methods, and events for custom objects. Custom properties can be created using public variable declarations in a class module. A preferred way of creating custom properties is to write public Property Get and Property Let procedures in the class module. Property Get procedures determine what happens when the property value is retrieved, and Property Let procedures determine what happens when the property is assigned. After you write the code for a custom object, the object can be used from other class modules or procedures by declaring the object and instantiating the object. The properties, methods, and events can be accessed in the custom object from the Visual Basic Editor Code window just like existing objects. You create custom methods by adding public procedures or functions to the class module. You can also add additional properties and methods to existing objects in the same way that you create your own properties and methods for objects. The only difference is that you place the code in the class module for the existing object, such as a form.

Now that you have learned how to work with existing objects and how to create your own objects, it’s time to learn how ActiveX Data Objects (ADO) can be used in your applications to interact with data in your database.




Beginning Access 2007 VBA
Beginning Access 2007 VBA
ISBN: 0470046848
EAN: 2147483647
Year: 2004
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net