Tech Off Post

Single Post Permalink

View Thread: Class Design
  • User profile image
    Sven Groot

    Sorry, I don't even know where to begin on this. I suggest you read up on what namespaces and classes are actually for as well as guidelines on naming and usage.

    I don't mean to offend, but what you've described makes no sense at all. What are you actually trying to accomplish?

    You also seem to have a completely wrong idea of what Shared means (it means the variable is shared between instances of the same class; even if you create 100 instances, there's only one copy of that variable and only one value). If you want them to be accessible from other classes in the same assembly only, use Friend (although the idea that a class would initialize the values of another class goes against everything that OO design is about, so I suggest you reconsider that). And ReadOnly fields can only be initialised (set the value on the same line as the declaration), they can never be assigned afterwards, regardless of their access level.