Click here to Skip to main content
14,664,322 members
Home » Discussions » C#
   

C#

 
QuestionRemoting vs Sockets Pin
nr10002202027-Jul-08 20:22
Membernr10002202027-Jul-08 20:22 
AnswerRe: Remoting vs Sockets Pin
Rutvik Dave8-Jul-08 8:46
professionalRutvik Dave8-Jul-08 8:46 
QuestionI cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 20:15
Membermucahit7-Jul-08 20:15 
AnswerRe: I cant make a full dynamic query in LINQ Pin
leppie7-Jul-08 21:04
Memberleppie7-Jul-08 21:04 
GeneralRe: I cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 22:04
Membermucahit7-Jul-08 22:04 
GeneralRe: I cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 23:05
Membermucahit7-Jul-08 23:05 
Questionsmart card Data Identification Pin
naveen20_57-Jul-08 18:52
Membernaveen20_57-Jul-08 18:52 
QuestionProblems with generic list data structure Pin
sam L7-Jul-08 18:03
Membersam L7-Jul-08 18:03 
I have two factory classes that both return a generic list of a data object class. Currently the code is using a switch statement to call a particular factory depending on some input. Code below the switch statement below depends on getting the list of data objects from different sources, but processing them the same.


List<Product> products = null;

switch (i)

{

case 1:

products = ProductFactory.GetProducts();

break;

case 2:

products = ItemFactory.GetItems();

break;

default:

break;

}


The problem is that if I want to add more factories from different sources... I would have to rewrite the code for the current builder class, i.e. add more statements to the switch. Since an unknown number of factory calls could be made to get the data objects from different sources (one factory returns from Oracle, one from SQL one from SAP, etc) the code needs to accommodate any new factory sources without having to recode.


Is there an easy way to accomplish this, please show me some sample code if there's a way to do so.

Thanks

-----------------------------
If you don't go after what you want, you'll never have it.
If you don't ask, the answer is always no. If you don't step
forward, you're always in the same place. -Nora Roberts

AnswerRe: Problems with generic list data structure Pin
leppie7-Jul-08 19:32
Memberleppie7-Jul-08 19:32 
GeneralRe: Problems with generic list data structure Pin
sam L7-Jul-08 20:00
Membersam L7-Jul-08 20:00 
GeneralRe: Problems with generic list data structure Pin
leppie7-Jul-08 21:02
Memberleppie7-Jul-08 21:02 
GeneralRe: Problems with generic list data structure Pin
sam L7-Jul-08 21:15
Membersam L7-Jul-08 21:15 
GeneralRe: Problems with generic list data structure Pin
leppie7-Jul-08 21:39
Memberleppie7-Jul-08 21:39 
AnswerRe: Problems with generic list data structure Pin
dibya_20037-Jul-08 19:50
Memberdibya_20037-Jul-08 19:50 
GeneralRe: Problems with generic list data structure Pin
leppie7-Jul-08 21:00
Memberleppie7-Jul-08 21:00 
AnswerRe: Problems with generic list data structure Pin
N a v a n e e t h7-Jul-08 21:32
MemberN a v a n e e t h7-Jul-08 21:32 
QuestionSetup and deployment for windows application Pin
vishnukamath7-Jul-08 18:03
Membervishnukamath7-Jul-08 18:03 
AnswerRe: Setup and deployment for windows application Pin
Rutvik Dave8-Jul-08 8:56
professionalRutvik Dave8-Jul-08 8:56 
QuestionPerformance Related bug in C# code Pin
Tina P7-Jul-08 17:56
MemberTina P7-Jul-08 17:56 
AnswerRe: Performance Related bug in C# code Pin
Ashfield7-Jul-08 21:09
MemberAshfield7-Jul-08 21:09 
GeneralRe: Performance Related bug in C# code Pin
Tina P7-Jul-08 21:21
MemberTina P7-Jul-08 21:21 
AnswerRe: Performance Related bug in C# code Pin
Harvey Saayman7-Jul-08 21:20
MemberHarvey Saayman7-Jul-08 21:20 
GeneralRe: Performance Related bug in C# code Pin
Tina P7-Jul-08 21:28
MemberTina P7-Jul-08 21:28 
GeneralRe: Performance Related bug in C# code Pin
Harvey Saayman7-Jul-08 21:40
MemberHarvey Saayman7-Jul-08 21:40 
GeneralRe: Performance Related bug in C# code Pin
Ashfield7-Jul-08 22:12
MemberAshfield7-Jul-08 22:12 

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.