Click here to Skip to main content
16,020,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: Task.Wait() -Why?? Pin
Pete O'Hanlon4-Apr-17 7:40
mvePete O'Hanlon4-Apr-17 7:40 
AnswerRe: Task.Wait() -Why?? Pin
Richard Deeming4-Apr-17 7:48
mveRichard Deeming4-Apr-17 7:48 
GeneralRe: Task.Wait() -Why?? Pin
Kevin Marois4-Apr-17 7:52
professionalKevin Marois4-Apr-17 7:52 
GeneralRe: Task.Wait() -Why?? Pin
Richard Deeming4-Apr-17 8:04
mveRichard Deeming4-Apr-17 8:04 
GeneralRe: Task.Wait() -Why?? Pin
Tridip Bhattacharjee5-Apr-17 23:30
professionalTridip Bhattacharjee5-Apr-17 23:30 
GeneralRe: Task.Wait() -Why?? Pin
Richard Deeming6-Apr-17 1:30
mveRichard Deeming6-Apr-17 1:30 
Questionin which scenario people use factory design patter Pin
Tridip Bhattacharjee4-Apr-17 1:58
professionalTridip Bhattacharjee4-Apr-17 1:58 
AnswerRe: in which scenario people use factory design patter Pin
Eddy Vluggen4-Apr-17 2:29
professionalEddy Vluggen4-Apr-17 2:29 
Tridip Bhattacharjee wrote:
i am looking for a write up on factory design patter which show me when i need to create instance by factory because we can create instance directly but in factory design pattern instance create via factory. so what is the significance of factory design patter.
A nice idea would be to create a factory if there are more than a single class than can be used to perform the action.

Simple and usefull example can be found in the DbProviderFactory. Instead of programming against the SqlConnection and SqlCommand, you program against the interfaces IDbConnection and IDbCommand. Next, let the factory decide which actual class to create. That way the user can configure suddenly whether to use the SqlConnection, an OracleConnection, or something completely different.

Another nice idea for factories is that they can also be combined with the Object Pool Pattern. See the TaskFactory for a nice example of that.

It's similar to the strategy-pattern, with the difference that a factory is for creating objects.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: in which scenario people use factory design patter Pin
Tridip Bhattacharjee4-Apr-17 3:48
professionalTridip Bhattacharjee4-Apr-17 3:48 
GeneralRe: in which scenario people use factory design patter Pin
Pete O'Hanlon4-Apr-17 4:14
mvePete O'Hanlon4-Apr-17 4:14 
GeneralRe: in which scenario people use factory design patter Pin
Gerry Schmitz4-Apr-17 4:36
mveGerry Schmitz4-Apr-17 4:36 
GeneralRe: in which scenario people use factory design patter Pin
Eddy Vluggen4-Apr-17 5:24
professionalEddy Vluggen4-Apr-17 5:24 
QuestionStrange Problem Loading Config File Pin
Kevin Marois3-Apr-17 7:51
professionalKevin Marois3-Apr-17 7:51 
AnswerRe: Strange Problem Loading Config File Pin
Richard Deeming3-Apr-17 8:03
mveRichard Deeming3-Apr-17 8:03 
GeneralRe: Strange Problem Loading Config File Pin
Kevin Marois3-Apr-17 8:07
professionalKevin Marois3-Apr-17 8:07 
QuestionUnderstanding IOC Pin
Liagapi2-Apr-17 21:06
Liagapi2-Apr-17 21:06 
AnswerRe: Understanding IOC Pin
Pete O'Hanlon2-Apr-17 22:41
mvePete O'Hanlon2-Apr-17 22:41 
GeneralRe: Understanding IOC Pin
Liagapi3-Apr-17 16:32
Liagapi3-Apr-17 16:32 
GeneralRe: Understanding IOC Pin
Pete O'Hanlon3-Apr-17 20:41
mvePete O'Hanlon3-Apr-17 20:41 
AnswerRe: Understanding IOC Pin
Bernhard Hiller3-Apr-17 21:24
Bernhard Hiller3-Apr-17 21:24 
AnswerRe: Understanding IOC Pin
Gerry Schmitz4-Apr-17 4:46
mveGerry Schmitz4-Apr-17 4:46 
AnswerRe: Understanding IOC Pin
Matthew Dennis4-Apr-17 6:43
sysadminMatthew Dennis4-Apr-17 6:43 
QuestionWindows Application C# Pin
Member 130625052-Apr-17 9:38
Member 130625052-Apr-17 9:38 
AnswerRe: Windows Application C# Pin
OriginalGriff2-Apr-17 10:15
mveOriginalGriff2-Apr-17 10:15 
AnswerRe: Windows Application C# Pin
Michael_Davies2-Apr-17 10:16
Michael_Davies2-Apr-17 10:16 

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.