module vs class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raymond Lewallen

    #1

    module vs class

    Whats the difference in using a module with all public functions versus
    using a class with all shared functions and a private constructor?

    Raymond Lewallen
    Federal Aviation Administration


  • Mattias Sjögren

    #2
    Re: module vs class

    Raymond,
    [color=blue]
    >Whats the difference in using a module with all public functions versus
    >using a class with all shared functions and a private constructor?[/color]

    In practice it's hardly any difference.

    With a private constructor the class can still be instantiated from
    within the class itself. A module can never be instantiated since it
    doesn't have any instance constructor, not even a private one.



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...