|
|
Warp <war### [at] tagpovrayorg> wrote:
> clipka <nomail@nomail> wrote:
> > Yes, modules occasionally *are* instantiated and referenced; but in typical
> > modular projects they're *not*, and instead just resemble code libraries.
>
> What makes you think that on typical modular projects modules are not
> instantiated?
>
> A string is a module (or can be one in most modular and OO languages), for
> example, and obviously you usually instantiate quite many times. Likewise
> things like file streams are often modules/objects in such languages.
Still, in a typical modular project it would be implemented as a library,
providing (A) a classic data structure to hold a string, and (B) classic
routines to operate on them. There may be talk about "instantiating" with
regard to the data structure, but not with regard to the module as a whole,
which might contain additional data structures such as a dedicated heap for the
strings to live in.
Most modular projects use a much too heavyweight concept of a module to
instantiate whole modules for such small stuff as a single string.
And those that do have a lightweight enough concept of a module typically fall
into the full-fledged OOP category anyway.
So no, in typical modular projects, modules are not instantiated. Unless the
system gets so big that it may need to live on multiple machines - in that
case, yes, modules are indeed very frequently instantiated: One instance per
machine.
Post a reply to this message
|
|