|
-
May 7th, 2003, 07:43 AM
#1
Thread Starter
Lively Member
Singleton Design Pattern & Facade Pattern
An interesting FAQ about the singleton design pattern. The examples are in C# altho the VB.NET implementation is very similar. (one difference is I tend to use the Mutex class rather than the VB Synclock or lock in C#)
Singleton Design Pattern
Last edited by shutty; Jun 9th, 2003 at 08:34 AM.
-
May 7th, 2003, 10:16 AM
#2
It seems easier to make good use of shared methods although I could see how that may not fit every situation.
-
May 7th, 2003, 10:27 AM
#3
Thread Starter
Lively Member
The product I'm involved with uses a singleton to control access to a database. Once the user starts up the application a connection is made. Only one connection is allowed and the use of a singleton ensures that the connection object cannot be created multiple times. Therefore the connection handle retrieved is guarenteed to be the correct one.
Of course shared methods are still used for other tasks when the uniqueness of the object is not as important.
-
May 7th, 2003, 11:55 AM
#4
Fanatic Member
Facade too.
And it's so easy to do! Sweet.
A pattern that I always use is Facade. The intent of the Façade design pattern is to provide a unified interface to a set of interfaces in a sub system. Using the facade pattern basically defines a high level interface that makes the subsystem easier to use.
This ultimately serves to reduce complexity, and to minimize the communication and dependencies between subsystems.
I can ALWAYS find a case to use this in every application - such as using a facade handle all database interaction.
-
May 7th, 2003, 12:09 PM
#5
Can you give us an example of a Facade Pattern or links to info on it?
-
May 7th, 2003, 02:47 PM
#6
Fanatic Member
Couldn't actually find any good links in English - but I reference the GOF's book - "Design Patterns" ISBN 0201633612.
-
May 8th, 2003, 03:30 AM
#7
Thread Starter
Lively Member
-
May 30th, 2003, 09:25 AM
#8
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|