"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Wouter Oet wrote:First of all remember that PatienceIsAVirtue. We are all volunteers that do this in our free time.
I use the java.util.Currency class and create a wrapper that contains the conversion values.
A simple Map would be sufficient. Or in a multi-threaded environment a ConcurrentMap.
Paul Clapham wrote:It seems that you might be getting the data from some database tables. In that case your first attempt at design should be to create classes which mirror those tables. Each column in a table should be implemented as a member of the class.
Why don't you start out with, say, your Currency table? Post the contents of the table (I mean the list of columns, not the data in the table) and a class you have written based on that. Then we can discuss it.
Deepak Lal wrote:Please advice..What datastructure should i use for implementing this.
Paul Clapham wrote:Well, that answers your original question, which was (to remind everyone reading this thread):
Deepak Lal wrote:Please advice..What datastructure should i use for implementing this.
So yes, that's a reasonable data structure to use. Do you have another specific question? "How should I proceed now" isn't a specific question which can reasonably be answered on a forum, except by saying "Next you should decide what you want to do with those data structures."
Deepak Lal wrote:@Paul,I have written the data structure,so my next question is how should i implement the currency converter which i have been discussing in this thread.
![]()
Paul Clapham wrote:
Deepak Lal wrote:@Paul,I have written the data structure,so my next question is how should i implement the currency converter which i have been discussing in this thread.
Well, first you should decide what things you want it to do. Then you write code which does those things. So how about if you get started with that? List the things you want it to do.
luck, db
There are no new questions, but there may be new answers.
Deepak Lal wrote:suppose i have 1 USD equivalent to 46 INR hence if i enter 12 USD it should give me the quivalent INR and point ot remember here is that INR rate is changing per sec/nanosec since im working in a real time Trade based Java application.so this is what im supposed to do,hope you have got my understanding now.Could you please tell me how should my implementation code be for this.
Not sure but I think the exchange rate changed daily basis not every second. Please rectify me if I am incorrect.INR rate is changing per sec/nanosec since im working in a real time Trade based Java application
Java Programmer | SCJP 1.5 | SCWCD 1.4
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |