Summary

Team Fly 

Page 473

Run the application and click the button. Ten seconds later you will see a message box with your computer's name. After that, the message box will pop up within a second after you click the same button. The object is pooled and need not be created again. If you remove the ObjectPooling attribute from the class's definition, recompile the component, and run the test project again, every time you click the button you'll wait for 10 seconds before seeing the message box on your desktop. Notice also that regardless of whether the component runs as a server or library application, the objects you create are pooled automatically.

Summary

In this chapter we discussed the importance of the middle-tier component in designing scalable applications. Middle-tier components are used commonly with large applications, because they simplify the tasks of maintaining and deploying the revised applications. Reinstalling a client application to a large number of workstations can be quite a task and any technique to simplify this task is welcome.

The maintenance of a large application is also greatly simplified if the application is built with components, because the middle tier can be revised independently of the presentation tier and be deployed on selected servers rather than on every client. If you choose to post the middle tier on a web server and expose its functionality through Web services, you can build both Windows and web clients that exploit the functionality of the middle tier to access the database, regardless of the actual location of the database. The clients will never interact with the database directly, and the objects of the middle-tier component abstract the view of the database at the presentation tier's level.

Finally, you learned how to use existing COM components with .NET clients, as well as how to develop serviced components in .NET. Serviced components provide the functionality of COM objects, such as automatic transactions, role-based security, and object pooling, which is new to VB developers.

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

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