Scenario

[Previous] [Next]

You've designed an application that requires only a single connection to a database. Different components of the application run unique queries against tables in the database. The database object is globally accessible to all objects in the system. You could define a global database object, but there is no feature in the Microsoft Visual Basic language to prevent a client from creating another instance. Implementing a Singleton design pattern will allow you to control the number of database objects that can be created.



Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

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