ARTICLE

Implementation of concrete Factory Design Pattern using Reflection in VB.NET

Posted by Siva Kumar B Articles | Visual Basic 2010 October 04, 2004
Reflection is used to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. In this example, we implement Concrete Factory Pattern using Reflection to fetch records from MS-Access and MS-SQL Database.
Download Files:
 
Reader Level:

In order for a Class A to create an instance of Class B, A must have a reference to B, which means that class B must be instantiated and a reference to object B must be available to A. A has a direct reference to B and they are tightly coupled.

In order to reduce tight coupling between these two objects, it is best to give the responsibility of creating B to a factory class using Reflection. It then becomes less coupled.

Reflection is used to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. In this example, we implement Concrete Factory Pattern using Reflection to fetch records from MS-Access and MS-SQL Database. It is possible to configure this application to retrieve data from Oracle DB also.

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor