Another thing to consider along these lines is just going full-force
with typing.  I've done this in the past for measurement systems and
it worked out very well.

Rather than having a bunch of BigDecimals hanging around with values
of different "types", you could create specific subclasses for the
various monetary types you want to support.  It's a little painful
but it's really the only way the business layer and presentation
layer can avoid the confusion that's bound to arise.  So if an object
is a Euro you display it as such, if it's a Dollar you display it as
dollars, etc..  That way you don't end up accidentally displaying
a dollar amount as pounds since the presentation layer can be smart
enough to format the type appropriately.

-Paul Speed

William Jaynes wrote:
> 
> Remember... separation of view from model. The act of displaying an
> amount in a particular currency format is separate from determining what
> that amount is. So the code used to implement the display of the amount
> should not be mixed up with the code used to determine the amount.
> 
> ----- Original Message -----
> From: "Jonathan Asbell" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 05, 2001 7:40 AM
> Subject: Re: Client/Server Side Validation for Struts 1.1
> 
> > Ok, so why then is this an issue.  What is the value of seeing Pounds
> AND
> > Euros on the same page if you dont want to realte their rates.  Ok, so
> I
> > could enter data using pounds, or enter data using Euros depending on
> my
> > personalization setting.  But what is the use of DISPLAYING both if
> you wont
> > give me then conversion?
> >
> > By the way Ted, you are up early man.  I guess it finally thawed out
> upstate
> > ;^>
> >
> > ----- Original Message -----
> > From: "Ted Husted" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 05, 2001 7:28 AM
> > Subject: Re: Client/Server Side Validation for Struts 1.1
> >
> >
> > > Wouldn't exchange rates count as business logic?
> > >
> > > I think the thrust here is the ability to take a given binary number
> and
> > > display it using the currency sign and format ($###.## vs ###,##DM]
> for
> > > a given nation. This package would consider the value immutable.
> Another
> > > player would have to change the binary value first, and then pass it
> > > along for formatting.
> > >
> > > Jonathan Asbell wrote:
> > > >
> > > > "Tonarino kyacua, yoku-ki-ka-ku Kyuacuda"
> > > >
> > > > What about allowing two or three different displays of currency,
> but
> > only
> > > > one type of currency for data entry.  That way I could be in
> England
> > > > entering pounds, but seeing display values in Pounds, Hong Kong $,
> and
> > Euro.
> > > > Of course this keeps making me think that at this point we are
> talking
> > about
> > > > accessing the current exchange rates, which than you would need a
> feed
> > etc.
> > > > This IS true because thereare countries in SOuth america whos
> currency
> > jumps
> > > > and dives each week, and you would not be presenting viewers with
> the
> > > > correct exchange.
> > >
> >

Reply via email to