Comment On Class IntWrapper

I've had the pleasure of working with a developer who strongly believes that all classes external to your assembly (even core framework classes) should be wrapped in an internal class. The idea goes something like this. If your external class ever changes and the author decides to make it not backwards compatable ... and the new version of the class is actually required, you only have to change your wrapper class once instead of having to do a global search and replace. [expand full text]
« PrevPage 1Next »

re: Class IntWrapper

2004-06-04 15:18 • by Randy Glenn
Wow.

re: Class IntWrapper

2004-06-04 15:46 • by Anthony
But what will he do if the String class changes? :-)

re: Class IntWrapper

2004-06-04 18:56 • by Thomas Eyde
Create a StringWrapper.

public class StringWrapper
{
private sealed int _value;

public StringWrapper(string s)
{
_value = int.Parse(s);
}

public int GetValue()
{
return _value;
}
}

Btw, is this a real beast? I saw that thing in Java the other day.

Hungarian notation anyone?

2004-06-05 02:37 • by Hristo Deshev
Does p_i stand for "integer parameter"? Gimme a break!

re: Class IntWrapper

2004-06-05 05:20 • by T1TAN
hhah... i like it! but we need to consider one thing.. there is a lack of DoubleWrapper, LongWrapper, FloatWrapper etc.. damn, who's gonna type all that code.. :)

re: Class IntWrapper

2004-06-05 16:09 • by Thomas Eyde
The Whidbey edition will save us C#'ers with generics:

public class Wrapper<T>

(I think generics will give us lot's of unwanted fun!)

re: Class IntWrapper

2004-06-06 00:28 • by vbNullString
What the fuck... This guy just went too far, man. Does he think Microsoft is stupid enough to change Integer implementation dramatically? Dude, he should create another wrapper that wraps IntWrapper in case IntWrapper changes dramatically. LOL

re: Class IntWrapper

2004-06-10 20:01 • by Paul D. Murphy
I think what the guy did is just plain stupid, but in Whidbey Microsoft 'is' changing the implementation of Int32 in order to accomadate the potential for a null value. At least that was the talk back at the SDR.

re: Class IntWrapper

2004-06-11 00:10 • by David L. Penton
Nullable Types was discussed on EricGu's blog: http://weblogs.asp.net/ericgu/archive/2004/05/27/143221.aspx

This isn't changing the Int32...it is introducing a new type based on the original type.

re: Class IntWrapper

2004-06-16 15:23 • by Jason Walker
Yeah, the above code is retarted, but according to Maximizing .Net Performance from APress (pg 72), if you do something similar to this:

public class IntWrapper {
public int Int;
}

to use in a collection, that It can speed up the boxing/unboxing process by up to 4 times.

Go Figure...

re: Class IntWrapper

2004-09-28 15:18 • by Eric Peterson
"...DoubleWrapper..."

Can I get that with cheese and a super-sized order of fries?
« PrevPage 1Next »

Add Comment