From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,900edaa189af2033 X-Google-Attributes: gid103376,public X-Google-Thread: 1008e3,8671b73b2d5c62b7,start X-Google-Attributes: gid1008e3,public From: Farshad Nayeri Subject: Re: Ada95 OOP Questions Date: 1996/08/20 Message-ID: <3219EB97.76B0@cmass.com>#1/1 X-Deja-AN: 175338814 cc: farshad@cmass.com, kalsow@cmass.com, steve@cmass.com content-type: text/plain; charset=us-ascii organization: Critical Mass, Inc. mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.modula3 x-mailer: Mozilla 2.02 (Win95; I) Date: 1996-08-20T00:00:00+00:00 List-Id: Eric Newton said: > The point of the (deleted) example was to show that > a package is just a namespace, and that multiple classes > can live in that namespace, and that the features of > the class do not need to be visibly associated > with the dispatch object. Matrixes encapsulates > Matrix *and* Vector types. I can list the Matrix and > Vector operations willy-nilly within this namespace. > In C++/Modula-3 I must list the operations on > the private state of Matrix within the Matrix class. > I must list the operations on the private state of > Vector within the Vector class. > There is visible association of dispatch methods and type. I believe this is an inaccurate representation of the way Modula-3 organizes namespaces and visibility. Much care went into designing namespaces and avoiding problems in the C++ "private" state model. Modula-3 has separate mechanisms for encapsulation (modules & interfaces) and inheritance and dispatching (object types). Using partial revelation--where one interface can reveal partial information about various types; others can import only the necessary features by importing that interface--Eric can do the kinds of groupings he was talking about. Steve Freeman has written a nice article for Dr. Dobb's Journal, comparing the encapsulation and grouping facilities of Ada95, C++, Eiffel, and Modula-3. He addresses precisely the kinds of issues that Eric mentioned and goes through code examples to illustrate his point. A copy of the article is available via the web: http://www.research.digital.com/SRC/modula-3/html/partial-rev/index.html Regards, -- Farshad -- Farshad Nayeri Critical Mass, Inc. http://www.cmass.com/ Disclaimer: I am biased!