Object Creational Patterns and Instantiation
page 3 of 10
by Brian Mains
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 42017/ 69

Creational Patterns

Armed with the above type-instantiation information, we can apply this to patterns and how they are used.  Especially in .NET applications, classes can make use of dynamic references, which are most often defined in the configuration file.  Within this file it is possible to specify a string containing the type name and assembly, similar to how you see it already in the .NET Framework.  Using the Type.GetType method, it is possible to obtain a reference to the type, if the framework can resolve it.  And from this, we have our basis for dynamically retrieving the object reference.

Now we begin to look at the creational patterns that are available.  If you are aware of the book "Design Patterns" by Gamma et. al, this book specifies five creational patterns that are most widely used when designing software.  We will look at some of those, and perhaps a few others.  Note, most patterns avoid directly instantiating an object through the constructor, and so the constructor is often declared private or internal.  It is up to you to determine whether you want to expose the constructor, or to instantiate through another means.  Let us begin by looking at the design patterns.


View Entire Article

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 4:49:10 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search