Junilu Lacar wrote:
David McWilliams wrote:Am I correct in saying I should have a separate strategy for each year?
That's probably too fine-grained for what you described. I would go for a strategy for each type of customer.That is, however many different interest tables you have, that would be how many strategies you'd have to implement and choose from.
Edit: Sorry, I thought you meant something else when I read "separate strategy for each year".
Another way might be to base it on the different sets of "bands" you have, then just parameterize the interest rates. In the examples you gave, you'd have two strategies, with the strategy with three bands being parameterized for it's interest rates. That might be over-complicating things though. I usually experiment with different approaches before I decide which one to go with. Seeing the code gives you a better feel for how maintainable and understandable it is vs. just thinking about it.
Campbell Ritchie wrote:Also do not use -1. How do you know you will get -1 back from the compareTo() method? If you look at its documentation, it says nothing about returning 1 or -1. It says negative positive or 0. It says signum returns -1 0 1, but you are not using signum.
Junilu Lacar wrote:Also, you have declared some pseudo constants--I say "pseudo" because they follow the naming convention but they're not declared as final--but you fail to use them in your calculations, preferring to use hard-coded values instead.
H Paul wrote:So mechanically:
1. Use JAXB to unmarshall xm string into a list of xml annotated Car class (ford)
2. Then use Jackson Json to jsonize the list of xml annotated Car class.
H Paul wrote:Can you clarify? Is that soapful or restful web service?
of all Car information.
Call external web service to get an XML file (as string)