Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom Types
Message
From
03/08/2007 13:08:20
 
 
To
03/08/2007 12:17:53
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Class design
Title:
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01245845
Message ID:
01245854
Views:
17
Hi Mike

I believe that in .NET 3.5, you will have the ability to apply additional methods to .NET base classes for just the kind of requirement you specify (not dissimilar to Ruby or adding a new method to a JavaScript prototype).

Right now, I would say that creating a custom decimal class to provide a "ToRoundedString" method is excessive.

If I wanted that, I would probably just create a static method in a helper class:-
// Numbers is the class name containing the static method ToRoundedString()
// You could put all of you number related helper method in this class.
Numbers.ToRoundedString(myDecimalVar)
HTH

-=Gary


>There has been some discussion in the past about using custom controls, even if the derived control doesn't provide any additional functionality.
>
>Could this idea also be applied to a variable (and is it recommended)? For example, if I find I am rounding decimals a certain way many times, would it be advantageous to create a custom decimal class with a .ToRoundedString method? Would I then want to use this derived type in place of all decimal types in my application?
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform