Click here to Skip to main content
15,896,269 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: "image processing" Pin
Eddy Vluggen8-Mar-09 2:57
professionalEddy Vluggen8-Mar-09 2:57 
QuestionDeployment of Dot Net installar Pin
BijayaSharma6-Mar-09 8:30
BijayaSharma6-Mar-09 8:30 
AnswerRe: Deployment of Dot Net installar Pin
Curtis Schlak.6-Mar-09 9:28
Curtis Schlak.6-Mar-09 9:28 
AnswerRe: Deployment of Dot Net installar Pin
BijayaSharma6-Mar-09 10:48
BijayaSharma6-Mar-09 10:48 
Questionsingleton v/s pooling Pin
nicetohaveyou6-Mar-09 6:21
nicetohaveyou6-Mar-09 6:21 
AnswerRe: singleton v/s pooling Pin
Curtis Schlak.6-Mar-09 6:57
Curtis Schlak.6-Mar-09 6:57 
GeneralRe: singleton v/s pooling Pin
nicetohaveyou8-Mar-09 7:21
nicetohaveyou8-Mar-09 7:21 
GeneralRe: singleton v/s pooling Pin
Curtis Schlak.9-Mar-09 2:22
Curtis Schlak.9-Mar-09 2:22 
Sure.
Singleton Example
Let's say that you're implementing an interpreter for a scripting language that contains some mathematical operators. Now, you design your language so that none of the objects that implement the operators (such as AddOperator, MultOperator) have state, just a collection of methods. To reduce the memory consumption of the interpreter, you can choose to have each of those operators as singletons, one instance of the AddOperator will exist in any AppDomain. This is in contrast to parsing the input and creating an AddOperator into an abstract syntax tree every time the parser encounters the + symbol.
Pool Example
Quite often in multi-threaded applications that access data from a persistent store, the connections that the applications use to connect to the persistent store are pooled. For example, it's a common practice to pool a certain number of connections to a database because it's so darn expensive to create the connection. Then, when an application wants to get data from the database, it asks the pool for a connection instead of creating its own.
I think that your confusion may be coming from the thought that "a resource pool is a singleton." That can be true and quite often is. In general, why would you create multiple pools of resource connections when that kind of defeats the purpose of having that limited number of expensive connections?

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty

GeneralRe: singleton v/s pooling Pin
nicetohaveyou9-Mar-09 6:29
nicetohaveyou9-Mar-09 6:29 
GeneralRe: singleton v/s pooling Pin
supercat99-Mar-09 6:31
supercat99-Mar-09 6:31 
GeneralRe: singleton v/s pooling Pin
Curtis Schlak.9-Mar-09 7:36
Curtis Schlak.9-Mar-09 7:36 
AnswerRe: singleton v/s pooling Pin
led mike6-Mar-09 8:33
led mike6-Mar-09 8:33 
JokeRe: singleton v/s pooling Pin
Curtis Schlak.6-Mar-09 9:29
Curtis Schlak.6-Mar-09 9:29 
GeneralRe: singleton v/s pooling Pin
Luc Pattyn6-Mar-09 10:28
sitebuilderLuc Pattyn6-Mar-09 10:28 
GeneralRe: singleton v/s pooling Pin
PIEBALDconsult10-Mar-09 7:12
mvePIEBALDconsult10-Mar-09 7:12 
Question[Message Deleted] Pin
Rajeev Dhiman5-Mar-09 23:49
Rajeev Dhiman5-Mar-09 23:49 
AnswerCrosspost Pin
Dave Kreskowiak6-Mar-09 4:19
mveDave Kreskowiak6-Mar-09 4:19 
Questionpatterns and practices Pin
Member 39813665-Mar-09 19:55
Member 39813665-Mar-09 19:55 
AnswerRe: patterns and practices Pin
Pete O'Hanlon5-Mar-09 23:17
mvePete O'Hanlon5-Mar-09 23:17 
AnswerRe: patterns and practices Pin
Curtis Schlak.6-Mar-09 1:52
Curtis Schlak.6-Mar-09 1:52 
AnswerRe: patterns and practices Pin
Mark Graham9-Mar-09 1:45
Mark Graham9-Mar-09 1:45 
Question(Windows CE 5.0) Emulator Pin
saksp5-Mar-09 19:34
saksp5-Mar-09 19:34 
Questionproblem in executing the dynamically refered dll in MMC Pin
renuga52985-Mar-09 18:50
renuga52985-Mar-09 18:50 
QuestionHelp needed for bluetooth application... Pin
Jain Vijay5-Mar-09 18:46
Jain Vijay5-Mar-09 18:46 
QuestionService/Object Locater Pin
Cybernate5-Mar-09 10:42
Cybernate5-Mar-09 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.