Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralMessage Closed Pin
22-Aug-10 23:36
stancrm22-Aug-10 23:36 
GeneralRe: Method in a class Pin
C.CoderCreator23-Aug-10 0:08
C.CoderCreator23-Aug-10 0:08 
GeneralRe: Method in a class Pin
Dave Kreskowiak23-Aug-10 4:06
mveDave Kreskowiak23-Aug-10 4:06 
GeneralRe: Method in a class Pin
Pete O'Hanlon23-Aug-10 4:41
mvePete O'Hanlon23-Aug-10 4:41 
GeneralMessage Closed Pin
23-Aug-10 12:53
_beauw_23-Aug-10 12:53 
GeneralRe: Method in a class Pin
Bernhard Hiller23-Aug-10 19:33
Bernhard Hiller23-Aug-10 19:33 
AnswerRe: Method in a class Pin
Abhinav S23-Aug-10 4:21
Abhinav S23-Aug-10 4:21 
QuestionThe strategy Pattern: a recurring problem Pin
pierpaolo paparo22-Aug-10 22:42
pierpaolo paparo22-Aug-10 22:42 
Hi,
Each time I try to sue the Strategy pattern, the concrete strategy have difference parameters.
For example the Strategy method could be a "double getprice()"
and a concreta class could need a matrix of interest rates, another classes a series of earning, other volatility numerbers and so on.

As opposed to this, most of the example I see on the web for the strategy pattern only involve either a series of commond paramters or no parameter at all to be passed to the strategy method.

So
1) Am I using the wrong patter to sort this problem?
2) If not how can I pass the Interface (IInstrment) to the client and give a way to the client to change the parameters?

For example


inferface IInstrument
{
double GetPrice()

}


class Stock : Instrument
{

double GetBody();
array[] double earnings{get;set}
double risk;
date today()

}

class Bonds : IInstrument
{
string GetBody();
double rate;

}


Thanks
AnswerRe: The strategy Pattern: a recurring problem Pin
Luc Pattyn23-Aug-10 1:17
sitebuilderLuc Pattyn23-Aug-10 1:17 
GeneralRe: The strategy Pattern: a recurring problem Pin
pierpaolo paparo23-Aug-10 2:58
pierpaolo paparo23-Aug-10 2:58 
AnswerRe: The strategy Pattern: a recurring problem Pin
Luc Pattyn23-Aug-10 3:16
sitebuilderLuc Pattyn23-Aug-10 3:16 
QuestionPassing values to external library Pin
Enobong Adahada22-Aug-10 21:57
Enobong Adahada22-Aug-10 21:57 
AnswerRe: Passing values to external library Pin
Calla22-Aug-10 22:03
Calla22-Aug-10 22:03 
GeneralRe: Passing values to external library Pin
Enobong Adahada22-Aug-10 22:55
Enobong Adahada22-Aug-10 22:55 
GeneralRe: Passing values to external library Pin
PIEBALDconsult23-Aug-10 16:37
mvePIEBALDconsult23-Aug-10 16:37 
QuestionRe: Passing values to external library Pin
Calla23-Aug-10 20:01
Calla23-Aug-10 20:01 
Questionremote standby or shutdown Pin
mannu8122-Aug-10 20:13
mannu8122-Aug-10 20:13 
AnswerMessage Closed Pin
22-Aug-10 20:53
stancrm22-Aug-10 20:53 
GeneralRe: remote standby or shutdown Pin
mannu8125-Aug-10 2:31
mannu8125-Aug-10 2:31 
AnswerRe: remote standby or shutdown Pin
phil.o22-Aug-10 21:41
professionalphil.o22-Aug-10 21:41 
AnswerRe: remote standby or shutdown [modified] Pin
Sunil G22-Aug-10 22:37
Sunil G22-Aug-10 22:37 
AnswerRe: remote standby or shutdown Pin
Luc Pattyn23-Aug-10 1:22
sitebuilderLuc Pattyn23-Aug-10 1:22 
GeneralRe: remote standby or shutdown Pin
Jesse Walker24-Aug-10 4:12
Jesse Walker24-Aug-10 4:12 
GeneralRe: remote standby or shutdown Pin
Luc Pattyn24-Aug-10 4:36
sitebuilderLuc Pattyn24-Aug-10 4:36 
QuestionCredRead Function. Does anyone know about it ?????????? Pin
one_in_one22-Aug-10 20:09
one_in_one22-Aug-10 20:09 

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.