| |
| Recipe 6.5: Using Transformations for Unit Conversions |
Last Updated: Sep 8, 2003
Status: Draft
|
|
|
|
How important is this problem to you?
(Login to Vote)
5.00 Rating, 1 Vote
|
|
How acceptable is the proposed solution?
(Login to Vote)
0.00 Rating, 0 Votes
|
|
Problem:
   
You want to create unit-aware classes; that is, classes that can perform unit conversions automatically.
Solution:
Create a simple base class to represent the "standard" unit, create subclasses for any other units to be supported, and set up from or as transformations:
Discussion:
|
|