Click here to Skip to main content
15,921,463 members
Home / Discussions / C#
   

C#

 
AnswerRe: Unknown Error Message Pin
Jon Sagara23-Apr-07 6:35
Jon Sagara23-Apr-07 6:35 
AnswerRe: Unknown Error Message Pin
Vikram A Punathambekar23-Apr-07 6:59
Vikram A Punathambekar23-Apr-07 6:59 
GeneralRe: Unknown Error Message Pin
JMOdom23-Apr-07 7:58
JMOdom23-Apr-07 7:58 
QuestionHow to convert .gif file contains text only to .doc formate in asp.net Pin
attalurisubbu23-Apr-07 4:49
attalurisubbu23-Apr-07 4:49 
AnswerRe: How to convert .gif file contains text only to .doc formate in asp.net Pin
Dave Kreskowiak23-Apr-07 5:56
mveDave Kreskowiak23-Apr-07 5:56 
QuestionHow Making windows Fax Services to send multiple faxes. Pin
Eddymvp23-Apr-07 4:33
Eddymvp23-Apr-07 4:33 
QuestionTrying to understand the Factory Pattern Pin
martin_hughes23-Apr-07 4:29
martin_hughes23-Apr-07 4:29 
AnswerRe: Trying to understand the Factory Pattern Pin
Vikram A Punathambekar23-Apr-07 7:13
Vikram A Punathambekar23-Apr-07 7:13 
WARNING: I'm new to Factory myself.

Utini wrote:
In the DAL what I do to create them is to loop through a DataReader object and pass the DataReader into the Entity's constructor. This works fine, but I can see the limitations to this approach, not least in that the Entity in question has to know about the DataReader type.


My understanding is that the Factory method would only take a simple object, like an identifying string or an int representing a code and use that to decide which class to instantiate. For instance, you pass "RFR" to instantiate a Reversal File Reader and "TDFR" to instantiate a Transaction Detail File Reader. What does your Factory method do with the DataReader? Surely it only uses a single value or two? Just modify the method so it takes only the relevant data, and make them native data types.

Utini wrote:
What I'm really struggling with is how to inject the Factory Pattern into this scenario - each class in the DAL is responsible for getting different types of object, and as far as I can see they're kind of unrelated.


Again, my understanding is that a Factory method is to be used when the objects it instantiates are similar in some way - typically/perhaps subclasses of the same superclass. While I think having a Factory method that returns different animals or different file readers is very good design, I wouldn't write a Factory method that returns a Tiger, an Apple, and a TransactionSummaryFileReader.

Again, I must emphasize that I'm new to patterns myself, so take whatever I've said with a pinch large dose of salt. I hope I made some sense, and will gladly welcome others' views on this.

Cheers,
Vikram.

"But nowadays, it means nothing. Features are never frozen, development keeps happening, bugs never get fixed, and documentation is something you might find on wikipedia."
- Marc Clifton on betas.
Join the CP group at NationStates. Password: byalmightybob

AnswerRe: Trying to understand the Factory Pattern Pin
Edmundisme23-Apr-07 11:00
Edmundisme23-Apr-07 11:00 
AnswerRe: Trying to understand the Factory Pattern Pin
martin_hughes10-May-07 8:41
martin_hughes10-May-07 8:41 
QuestionByte conversion fails Pin
AAKAra23-Apr-07 4:25
AAKAra23-Apr-07 4:25 
AnswerRe: Byte conversion fails Pin
Judah Gabriel Himango23-Apr-07 4:28
sponsorJudah Gabriel Himango23-Apr-07 4:28 
GeneralRe: Byte conversion fails Pin
AAKAra23-Apr-07 4:31
AAKAra23-Apr-07 4:31 
GeneralRe: Byte conversion fails Pin
Judah Gabriel Himango23-Apr-07 4:43
sponsorJudah Gabriel Himango23-Apr-07 4:43 
GeneralRe: Byte conversion fails Pin
AAKAra23-Apr-07 4:50
AAKAra23-Apr-07 4:50 
GeneralRe: Byte conversion fails Pin
AAKAra23-Apr-07 7:55
AAKAra23-Apr-07 7:55 
AnswerRe: Byte conversion fails Pin
Luc Pattyn23-Apr-07 8:29
sitebuilderLuc Pattyn23-Apr-07 8:29 
GeneralRe: Byte conversion fails [modified] Pin
AAKAra23-Apr-07 9:04
AAKAra23-Apr-07 9:04 
GeneralRe: Byte conversion fails Pin
Luc Pattyn23-Apr-07 9:37
sitebuilderLuc Pattyn23-Apr-07 9:37 
QuestionSelecting Row in GridView to show another GridView Pin
junisulaiman23-Apr-07 4:23
junisulaiman23-Apr-07 4:23 
AnswerRe: Selecting Row in GridView to show another GridView Pin
SABhatti23-Apr-07 5:36
SABhatti23-Apr-07 5:36 
GeneralRe: Selecting Row in GridView to show another GridView Pin
junisulaiman2-May-07 7:00
junisulaiman2-May-07 7:00 
GeneralRe: Selecting Row in GridView to show another GridView Pin
SABhatti2-May-07 13:16
SABhatti2-May-07 13:16 
QuestionDigital Persona 4000B Finer Reader Pin
| Muhammad Waqas Butt |23-Apr-07 3:49
professional| Muhammad Waqas Butt |23-Apr-07 3:49 
AnswerRe: Digital Persona 4000B Finer Reader Pin
Judah Gabriel Himango23-Apr-07 4:08
sponsorJudah Gabriel Himango23-Apr-07 4:08 

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.