From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA32380; Sun, 21 Jul 2002 15:07:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA32370 for ; Sun, 21 Jul 2002 15:07:06 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com (r-mi214-6a80.tin.it [62.211.4.80]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6LD74j23088 for ; Sun, 21 Jul 2002 15:07:04 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id B29A82724B for ; Sun, 21 Jul 2002 15:14:26 +0200 (CEST) Message-ID: <3D3AB3B2.7070701@baretta.com> Date: Sun, 21 Jul 2002 15:14:26 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: it, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Protected methods References: <3D369B89.1030000@baretta.com> <3D39F829.6060307@baretta.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dmitry Bely wrote: > Alessandro Baretta writes: > > But why do you need to call other instance's private/protected > methods? Maybe you should slightly change your design? Could you roughly > describe your task? > > - Dmitry Bely Yes. I have a class whose instances are responsible for formatting specific XML trees. Each instance is responsible for generating a text box which is decomposed in a header, a body, and a footer. While a given object handles directly the body of a text box, it delegates the header and the footer to two other instances of the same class, in a "has-a" relation with the former. This decomposition can be done recursively, thereby yielding an object tree or hierarchy. There are methods that are only meaningful when called by the body object on the header and footer objects. Client classes of this text box class are not supposed to invoke those methods that are used for data exchange between two objects associated by the above "has-a" relation. Alex ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners