N
nobody
I just tried to do something and realized I'm not sure of the proper (if
there *IS* a proper) way to do it. I'm designing a class with a lot a
methods/properties. I would like to group some of them so you access them
like MyObject.Commands.blah1, MyObject.Commands.blah2, etc... So some of
the methods are grouped under "Commands".
My first thought was a nested class, but how would the methods in the nested
Commands object (easily) access the data members of MyObject? I realy don't
want to have to create an instance of Commands and pass it a bunch of data
to initialize it. All I want to do is group methods/properties of MyObject
so the user of the class doesn't have to deal with tons of methods off the
root of the object.
Am I thinking along the wrong lines? Is there another/better/more proper
way to do this? Or am I crazy for even wanting to do such a strange thing?
there *IS* a proper) way to do it. I'm designing a class with a lot a
methods/properties. I would like to group some of them so you access them
like MyObject.Commands.blah1, MyObject.Commands.blah2, etc... So some of
the methods are grouped under "Commands".
My first thought was a nested class, but how would the methods in the nested
Commands object (easily) access the data members of MyObject? I realy don't
want to have to create an instance of Commands and pass it a bunch of data
to initialize it. All I want to do is group methods/properties of MyObject
so the user of the class doesn't have to deal with tons of methods off the
root of the object.
Am I thinking along the wrong lines? Is there another/better/more proper
way to do this? Or am I crazy for even wanting to do such a strange thing?