Proper use of a generic value type wrapper class











up vote
3
down vote

favorite












I have a wrapper class:



[Serializable]
// (465 references)
public class Value<T>
{
private T value;

[NonSerialized]
private List<IValueListener<T>> listeners = new List<IValueListener<T>>();

// (232 references)
public Value(T value)
{
this.value = value;
}

// (274 references)
public T Get()
{
return value;
}

// (18 references)
public void Set(T value)
{
if (!this.value.Equals(value))
{
this.value = value;

foreach (IValueListener<T> listener in listeners)
{
listener.ValueUpdated(this);
}
}
}

public void AddListener(IValueListener<T> listener)
{
listeners.Add(listener);
}

public void RemoveListener(IValueListener<T> listener)
{
listeners.Remove(listener);
}
}


The listener interface:



public interface IValueListener<T>
{
void ValueUpdated(Value<T> source);
}


It's used in a program that alters save files of a game. An object is constructed using the save file data and any value types encountered are wrapped in the Value class. Object is then managed by the program and the save file is rewritten from the objects data upon saving.



The listener is here since altering some data in the save file influences other, so this gives me a way to manage that on a low level (instead of making TextBoxes notify each other).



When I save the file, I actually clone the object, process the clone for saving and save the clone. That's why the class is Serializable. I don't care about listeners when saving so the list of them isn't.



My question is whether what I have done here is a well written code or should it be substituted with something else.



I also copied some of the # of references that VS displays just to demonstrate how heavily this class is used.










share|improve this question




























    up vote
    3
    down vote

    favorite












    I have a wrapper class:



    [Serializable]
    // (465 references)
    public class Value<T>
    {
    private T value;

    [NonSerialized]
    private List<IValueListener<T>> listeners = new List<IValueListener<T>>();

    // (232 references)
    public Value(T value)
    {
    this.value = value;
    }

    // (274 references)
    public T Get()
    {
    return value;
    }

    // (18 references)
    public void Set(T value)
    {
    if (!this.value.Equals(value))
    {
    this.value = value;

    foreach (IValueListener<T> listener in listeners)
    {
    listener.ValueUpdated(this);
    }
    }
    }

    public void AddListener(IValueListener<T> listener)
    {
    listeners.Add(listener);
    }

    public void RemoveListener(IValueListener<T> listener)
    {
    listeners.Remove(listener);
    }
    }


    The listener interface:



    public interface IValueListener<T>
    {
    void ValueUpdated(Value<T> source);
    }


    It's used in a program that alters save files of a game. An object is constructed using the save file data and any value types encountered are wrapped in the Value class. Object is then managed by the program and the save file is rewritten from the objects data upon saving.



    The listener is here since altering some data in the save file influences other, so this gives me a way to manage that on a low level (instead of making TextBoxes notify each other).



    When I save the file, I actually clone the object, process the clone for saving and save the clone. That's why the class is Serializable. I don't care about listeners when saving so the list of them isn't.



    My question is whether what I have done here is a well written code or should it be substituted with something else.



    I also copied some of the # of references that VS displays just to demonstrate how heavily this class is used.










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have a wrapper class:



      [Serializable]
      // (465 references)
      public class Value<T>
      {
      private T value;

      [NonSerialized]
      private List<IValueListener<T>> listeners = new List<IValueListener<T>>();

      // (232 references)
      public Value(T value)
      {
      this.value = value;
      }

      // (274 references)
      public T Get()
      {
      return value;
      }

      // (18 references)
      public void Set(T value)
      {
      if (!this.value.Equals(value))
      {
      this.value = value;

      foreach (IValueListener<T> listener in listeners)
      {
      listener.ValueUpdated(this);
      }
      }
      }

      public void AddListener(IValueListener<T> listener)
      {
      listeners.Add(listener);
      }

      public void RemoveListener(IValueListener<T> listener)
      {
      listeners.Remove(listener);
      }
      }


      The listener interface:



      public interface IValueListener<T>
      {
      void ValueUpdated(Value<T> source);
      }


      It's used in a program that alters save files of a game. An object is constructed using the save file data and any value types encountered are wrapped in the Value class. Object is then managed by the program and the save file is rewritten from the objects data upon saving.



      The listener is here since altering some data in the save file influences other, so this gives me a way to manage that on a low level (instead of making TextBoxes notify each other).



      When I save the file, I actually clone the object, process the clone for saving and save the clone. That's why the class is Serializable. I don't care about listeners when saving so the list of them isn't.



      My question is whether what I have done here is a well written code or should it be substituted with something else.



      I also copied some of the # of references that VS displays just to demonstrate how heavily this class is used.










      share|improve this question















      I have a wrapper class:



      [Serializable]
      // (465 references)
      public class Value<T>
      {
      private T value;

      [NonSerialized]
      private List<IValueListener<T>> listeners = new List<IValueListener<T>>();

      // (232 references)
      public Value(T value)
      {
      this.value = value;
      }

      // (274 references)
      public T Get()
      {
      return value;
      }

      // (18 references)
      public void Set(T value)
      {
      if (!this.value.Equals(value))
      {
      this.value = value;

      foreach (IValueListener<T> listener in listeners)
      {
      listener.ValueUpdated(this);
      }
      }
      }

      public void AddListener(IValueListener<T> listener)
      {
      listeners.Add(listener);
      }

      public void RemoveListener(IValueListener<T> listener)
      {
      listeners.Remove(listener);
      }
      }


      The listener interface:



      public interface IValueListener<T>
      {
      void ValueUpdated(Value<T> source);
      }


      It's used in a program that alters save files of a game. An object is constructed using the save file data and any value types encountered are wrapped in the Value class. Object is then managed by the program and the save file is rewritten from the objects data upon saving.



      The listener is here since altering some data in the save file influences other, so this gives me a way to manage that on a low level (instead of making TextBoxes notify each other).



      When I save the file, I actually clone the object, process the clone for saving and save the clone. That's why the class is Serializable. I don't care about listeners when saving so the list of them isn't.



      My question is whether what I have done here is a well written code or should it be substituted with something else.



      I also copied some of the # of references that VS displays just to demonstrate how heavily this class is used.







      c# wrapper






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Toby Speight

      22.4k537109




      22.4k537109










      asked Sep 15 '16 at 21:45









      Karlovsky120

      16517




      16517






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          You obviously implemented the Observer pattern here.



          So let's improve the naming and the overall design so that the pupose of each class and method is clear to the user.



          First instead of just Value the class should be called ObservableValue and consequently the interface should be:



          public interface IObservableValue<T>
          {
          void Subscribe(IObserver<T> observer);
          void Unsubscribe(IObserver<T> observer);
          }


          the IValueListener interface becomes IObserver:



          public interface IObserver<T>
          {
          void Notify(T value);
          }


          Then the new class would look like this:



          [Serializable]
          public class ObservableValue<T> : IObservableValue<T>
          {
          private T _value;

          [NonSerialized]
          private List<IObserver<T>> _observers = new List<IObserver<T>>();

          public ObservableValue(T value)
          {
          _value = value;
          }

          public T Get()
          {
          return _value;
          }

          public void Set(T value)
          {
          if (!_value.Equals(value))
          {
          _value = value;
          NotifyObservers();
          }
          }

          public void Subscribe(IObserver<T> observer)
          {
          _observers.Add(observer);
          }

          public void Unsubscribe(IObserver<T> observer)
          {
          _observers.Remove(observer);
          }

          private void NotifyObservers()
          {
          foreach (var observer in _observers)
          {
          observer.Notify(_value);
          }
          }
          }


          I used the T as a parameter for the Notify method but if you really need it to be the IObservableValue that it's a minor adjustment.






          share|improve this answer




























            up vote
            2
            down vote













            It is unclear how to use this class if I want to subscribe to two different objects that implement, say, Value<double>. There is no way to tell which of the two values has changed. This looks like a pretty major design flaw, unless I am missing something. So you should probably either use regular events (so I can supply different handlers for different values) or provide "source" argument. Personally, I think first option is better. You should also consider using proper event aggregator instead of storing the list of listeners in values themselves.



            Also I think you should have an actual property instead of Get() and Set() methods. And you can make listeners field read-only.






            share|improve this answer























            • I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
              – Karlovsky120
              Sep 16 '16 at 15:05


















            up vote
            2
            down vote













            As the type seems to be used often, note that the observers/listeners have to be unsubscribed to avoid memory leaks. If that is not easy possible, one option is to store the observers/listeners as weak references so that the GC collects them if they are not references anywhere else.



            [...]

            [NonSerialized]
            private List<WeakReference<IObserver<T>>> _observers = new List<WeakReference<IObserver<T>>>();

            [...]

            public void Subscribe(IObserver<T> observer)
            {
            _observers.Add(new WeakReference<IObserver<T>>(observer));
            }

            [...]

            private void NotifyObservers()
            {
            IObserver<T> observer;
            foreach (var observerRef in _observers)
            {
            if (observerRef.TryGetTarget(out observer))
            {
            observer.Notify(_value);
            }
            }
            }





            share|improve this answer





















              Your Answer





              StackExchange.ifUsing("editor", function () {
              return StackExchange.using("mathjaxEditing", function () {
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
              });
              });
              }, "mathjax-editing");

              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "196"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f141475%2fproper-use-of-a-generic-value-type-wrapper-class%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              You obviously implemented the Observer pattern here.



              So let's improve the naming and the overall design so that the pupose of each class and method is clear to the user.



              First instead of just Value the class should be called ObservableValue and consequently the interface should be:



              public interface IObservableValue<T>
              {
              void Subscribe(IObserver<T> observer);
              void Unsubscribe(IObserver<T> observer);
              }


              the IValueListener interface becomes IObserver:



              public interface IObserver<T>
              {
              void Notify(T value);
              }


              Then the new class would look like this:



              [Serializable]
              public class ObservableValue<T> : IObservableValue<T>
              {
              private T _value;

              [NonSerialized]
              private List<IObserver<T>> _observers = new List<IObserver<T>>();

              public ObservableValue(T value)
              {
              _value = value;
              }

              public T Get()
              {
              return _value;
              }

              public void Set(T value)
              {
              if (!_value.Equals(value))
              {
              _value = value;
              NotifyObservers();
              }
              }

              public void Subscribe(IObserver<T> observer)
              {
              _observers.Add(observer);
              }

              public void Unsubscribe(IObserver<T> observer)
              {
              _observers.Remove(observer);
              }

              private void NotifyObservers()
              {
              foreach (var observer in _observers)
              {
              observer.Notify(_value);
              }
              }
              }


              I used the T as a parameter for the Notify method but if you really need it to be the IObservableValue that it's a minor adjustment.






              share|improve this answer

























                up vote
                2
                down vote













                You obviously implemented the Observer pattern here.



                So let's improve the naming and the overall design so that the pupose of each class and method is clear to the user.



                First instead of just Value the class should be called ObservableValue and consequently the interface should be:



                public interface IObservableValue<T>
                {
                void Subscribe(IObserver<T> observer);
                void Unsubscribe(IObserver<T> observer);
                }


                the IValueListener interface becomes IObserver:



                public interface IObserver<T>
                {
                void Notify(T value);
                }


                Then the new class would look like this:



                [Serializable]
                public class ObservableValue<T> : IObservableValue<T>
                {
                private T _value;

                [NonSerialized]
                private List<IObserver<T>> _observers = new List<IObserver<T>>();

                public ObservableValue(T value)
                {
                _value = value;
                }

                public T Get()
                {
                return _value;
                }

                public void Set(T value)
                {
                if (!_value.Equals(value))
                {
                _value = value;
                NotifyObservers();
                }
                }

                public void Subscribe(IObserver<T> observer)
                {
                _observers.Add(observer);
                }

                public void Unsubscribe(IObserver<T> observer)
                {
                _observers.Remove(observer);
                }

                private void NotifyObservers()
                {
                foreach (var observer in _observers)
                {
                observer.Notify(_value);
                }
                }
                }


                I used the T as a parameter for the Notify method but if you really need it to be the IObservableValue that it's a minor adjustment.






                share|improve this answer























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  You obviously implemented the Observer pattern here.



                  So let's improve the naming and the overall design so that the pupose of each class and method is clear to the user.



                  First instead of just Value the class should be called ObservableValue and consequently the interface should be:



                  public interface IObservableValue<T>
                  {
                  void Subscribe(IObserver<T> observer);
                  void Unsubscribe(IObserver<T> observer);
                  }


                  the IValueListener interface becomes IObserver:



                  public interface IObserver<T>
                  {
                  void Notify(T value);
                  }


                  Then the new class would look like this:



                  [Serializable]
                  public class ObservableValue<T> : IObservableValue<T>
                  {
                  private T _value;

                  [NonSerialized]
                  private List<IObserver<T>> _observers = new List<IObserver<T>>();

                  public ObservableValue(T value)
                  {
                  _value = value;
                  }

                  public T Get()
                  {
                  return _value;
                  }

                  public void Set(T value)
                  {
                  if (!_value.Equals(value))
                  {
                  _value = value;
                  NotifyObservers();
                  }
                  }

                  public void Subscribe(IObserver<T> observer)
                  {
                  _observers.Add(observer);
                  }

                  public void Unsubscribe(IObserver<T> observer)
                  {
                  _observers.Remove(observer);
                  }

                  private void NotifyObservers()
                  {
                  foreach (var observer in _observers)
                  {
                  observer.Notify(_value);
                  }
                  }
                  }


                  I used the T as a parameter for the Notify method but if you really need it to be the IObservableValue that it's a minor adjustment.






                  share|improve this answer












                  You obviously implemented the Observer pattern here.



                  So let's improve the naming and the overall design so that the pupose of each class and method is clear to the user.



                  First instead of just Value the class should be called ObservableValue and consequently the interface should be:



                  public interface IObservableValue<T>
                  {
                  void Subscribe(IObserver<T> observer);
                  void Unsubscribe(IObserver<T> observer);
                  }


                  the IValueListener interface becomes IObserver:



                  public interface IObserver<T>
                  {
                  void Notify(T value);
                  }


                  Then the new class would look like this:



                  [Serializable]
                  public class ObservableValue<T> : IObservableValue<T>
                  {
                  private T _value;

                  [NonSerialized]
                  private List<IObserver<T>> _observers = new List<IObserver<T>>();

                  public ObservableValue(T value)
                  {
                  _value = value;
                  }

                  public T Get()
                  {
                  return _value;
                  }

                  public void Set(T value)
                  {
                  if (!_value.Equals(value))
                  {
                  _value = value;
                  NotifyObservers();
                  }
                  }

                  public void Subscribe(IObserver<T> observer)
                  {
                  _observers.Add(observer);
                  }

                  public void Unsubscribe(IObserver<T> observer)
                  {
                  _observers.Remove(observer);
                  }

                  private void NotifyObservers()
                  {
                  foreach (var observer in _observers)
                  {
                  observer.Notify(_value);
                  }
                  }
                  }


                  I used the T as a parameter for the Notify method but if you really need it to be the IObservableValue that it's a minor adjustment.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 16 '16 at 7:59









                  t3chb0t

                  33.7k744108




                  33.7k744108
























                      up vote
                      2
                      down vote













                      It is unclear how to use this class if I want to subscribe to two different objects that implement, say, Value<double>. There is no way to tell which of the two values has changed. This looks like a pretty major design flaw, unless I am missing something. So you should probably either use regular events (so I can supply different handlers for different values) or provide "source" argument. Personally, I think first option is better. You should also consider using proper event aggregator instead of storing the list of listeners in values themselves.



                      Also I think you should have an actual property instead of Get() and Set() methods. And you can make listeners field read-only.






                      share|improve this answer























                      • I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                        – Karlovsky120
                        Sep 16 '16 at 15:05















                      up vote
                      2
                      down vote













                      It is unclear how to use this class if I want to subscribe to two different objects that implement, say, Value<double>. There is no way to tell which of the two values has changed. This looks like a pretty major design flaw, unless I am missing something. So you should probably either use regular events (so I can supply different handlers for different values) or provide "source" argument. Personally, I think first option is better. You should also consider using proper event aggregator instead of storing the list of listeners in values themselves.



                      Also I think you should have an actual property instead of Get() and Set() methods. And you can make listeners field read-only.






                      share|improve this answer























                      • I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                        – Karlovsky120
                        Sep 16 '16 at 15:05













                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      It is unclear how to use this class if I want to subscribe to two different objects that implement, say, Value<double>. There is no way to tell which of the two values has changed. This looks like a pretty major design flaw, unless I am missing something. So you should probably either use regular events (so I can supply different handlers for different values) or provide "source" argument. Personally, I think first option is better. You should also consider using proper event aggregator instead of storing the list of listeners in values themselves.



                      Also I think you should have an actual property instead of Get() and Set() methods. And you can make listeners field read-only.






                      share|improve this answer














                      It is unclear how to use this class if I want to subscribe to two different objects that implement, say, Value<double>. There is no way to tell which of the two values has changed. This looks like a pretty major design flaw, unless I am missing something. So you should probably either use regular events (so I can supply different handlers for different values) or provide "source" argument. Personally, I think first option is better. You should also consider using proper event aggregator instead of storing the list of listeners in values themselves.



                      Also I think you should have an actual property instead of Get() and Set() methods. And you can make listeners field read-only.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Sep 16 '16 at 8:03

























                      answered Sep 16 '16 at 7:58









                      Nikita B

                      12.4k11752




                      12.4k11752












                      • I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                        – Karlovsky120
                        Sep 16 '16 at 15:05


















                      • I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                        – Karlovsky120
                        Sep 16 '16 at 15:05
















                      I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                      – Karlovsky120
                      Sep 16 '16 at 15:05




                      I did provide source argument. When listener triggers, it will pass the source of the update. It's not very pretty, but I couldn't think of a way to listen to e.g. two Value<double> otherwise.
                      – Karlovsky120
                      Sep 16 '16 at 15:05










                      up vote
                      2
                      down vote













                      As the type seems to be used often, note that the observers/listeners have to be unsubscribed to avoid memory leaks. If that is not easy possible, one option is to store the observers/listeners as weak references so that the GC collects them if they are not references anywhere else.



                      [...]

                      [NonSerialized]
                      private List<WeakReference<IObserver<T>>> _observers = new List<WeakReference<IObserver<T>>>();

                      [...]

                      public void Subscribe(IObserver<T> observer)
                      {
                      _observers.Add(new WeakReference<IObserver<T>>(observer));
                      }

                      [...]

                      private void NotifyObservers()
                      {
                      IObserver<T> observer;
                      foreach (var observerRef in _observers)
                      {
                      if (observerRef.TryGetTarget(out observer))
                      {
                      observer.Notify(_value);
                      }
                      }
                      }





                      share|improve this answer

























                        up vote
                        2
                        down vote













                        As the type seems to be used often, note that the observers/listeners have to be unsubscribed to avoid memory leaks. If that is not easy possible, one option is to store the observers/listeners as weak references so that the GC collects them if they are not references anywhere else.



                        [...]

                        [NonSerialized]
                        private List<WeakReference<IObserver<T>>> _observers = new List<WeakReference<IObserver<T>>>();

                        [...]

                        public void Subscribe(IObserver<T> observer)
                        {
                        _observers.Add(new WeakReference<IObserver<T>>(observer));
                        }

                        [...]

                        private void NotifyObservers()
                        {
                        IObserver<T> observer;
                        foreach (var observerRef in _observers)
                        {
                        if (observerRef.TryGetTarget(out observer))
                        {
                        observer.Notify(_value);
                        }
                        }
                        }





                        share|improve this answer























                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          As the type seems to be used often, note that the observers/listeners have to be unsubscribed to avoid memory leaks. If that is not easy possible, one option is to store the observers/listeners as weak references so that the GC collects them if they are not references anywhere else.



                          [...]

                          [NonSerialized]
                          private List<WeakReference<IObserver<T>>> _observers = new List<WeakReference<IObserver<T>>>();

                          [...]

                          public void Subscribe(IObserver<T> observer)
                          {
                          _observers.Add(new WeakReference<IObserver<T>>(observer));
                          }

                          [...]

                          private void NotifyObservers()
                          {
                          IObserver<T> observer;
                          foreach (var observerRef in _observers)
                          {
                          if (observerRef.TryGetTarget(out observer))
                          {
                          observer.Notify(_value);
                          }
                          }
                          }





                          share|improve this answer












                          As the type seems to be used often, note that the observers/listeners have to be unsubscribed to avoid memory leaks. If that is not easy possible, one option is to store the observers/listeners as weak references so that the GC collects them if they are not references anywhere else.



                          [...]

                          [NonSerialized]
                          private List<WeakReference<IObserver<T>>> _observers = new List<WeakReference<IObserver<T>>>();

                          [...]

                          public void Subscribe(IObserver<T> observer)
                          {
                          _observers.Add(new WeakReference<IObserver<T>>(observer));
                          }

                          [...]

                          private void NotifyObservers()
                          {
                          IObserver<T> observer;
                          foreach (var observerRef in _observers)
                          {
                          if (observerRef.TryGetTarget(out observer))
                          {
                          observer.Notify(_value);
                          }
                          }
                          }






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 16 '16 at 8:52









                          JanDotNet

                          6,5261238




                          6,5261238






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f141475%2fproper-use-of-a-generic-value-type-wrapper-class%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Mont Emei

                              Province de Neuquén

                              Journaliste