Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Mitchell, Brian, VBAVACO" <IMCBMITC@vba.va.gov>
To: "'caml-list@inria.fr'" <caml-list@inria.fr>
Cc: "Mitchell, Brian, VBAVACO" <IMCBMITC@vba.va.gov>
Subject: Encapsulation in Objective Caml
Date: Thu, 20 Aug 1998 10:51:26 -0400	[thread overview]
Message-ID: <c=US%a=_%p=VA%l=VBAVACO2-980820145126Z-11598@mail.va.gov> (raw)

Greetings,

I have recently begun to use Objective Caml...including reading as much
documentation as possible.  However, I have a question that I did not
see within the latest documentation version (ocaml 2.00).

1. How is encapsulation handled in Objective Caml 2.0

I want to hide implementation details of a class.  Then, the user can
only perform a restricted set of operations on the hidden members of the
class by executing special functions commonly called methods. The
actions performed by the methods are determined by me..of course, that
means I must be careful not to make the methods either overly flexible
or too restrictive.


2. How does this vary from Java or C++ ?

For instance, the concept of data encapsulation in C++ is through the
use of the public, protected and private keywords, which are placed in
the declaration of the class. Anything in the class placed after the
public keyword is accessible to all the users of the class; elements
placed after the protected keyword are accessible only to the methods of
the class or classes derived from that class; elements placed after the
private keyword are accessible only to the methods of the class.


3. Is it possible to use Messaging in OCaml 2.0 ?

When I refer to "Messaging", I mean calling a method of an object
instantiated from a class.


----------------- Français -----------------

Salutations,

J'ai récemment commencé à utiliser Objective Caml ... comprenant la
lecture autant documentation que possible. Cependant, j'ai une question
que je n'ai pas vue dans la dernière version de documentation (ocaml
2,00).

1. Va comment l'encapsulation manipulée dans Objective Caml 2,0

Je veux cacher des détails de mise en place d'une classe. Puis,
l'utilisateur peut seulement exécuter un ensemble restreint d'exécutions
sur les membres cachés de la classe en exécutant des méthodes
généralement appelées spéciales de
fonctions. Les actions exécutées par les méthodes sont déterminées par
le cours de me..bien sur, ce des moyens que je dois faire attention à ne
pas rendre les méthodes excessivement flexibles ou trop restrictives.


2. Comment est-ce que ceci change de Java ou de C++?

Par exemple, le concept de l'emballage des données dans C++ est par
d'utilisation des mots-clés de public, protégée et privés, qui sont
placés dans la déclaration de la classe. Quelque chose dans la classe
placée après le mot-clé public est accessible à tous les utilisateurs de
la classe; éléments placés après que le mot-clé protégé soient
accessible seulement aux méthodes de classe ou
de classes dérivées de cette classe; les éléments placés après le
mot-clé privé sont accessibles seulement aux méthodes de classe.


3. Est-il possible d'utiliser la transmission de messages dans OCaml
2,0?

Quand je me réfère à l'" transmission de messages ", je veux dire
qu'appelant une méthode d'objet instantiated d'une classe.



Thank you (merci),

Brian Mitchell

public class seniorSystemsAnalyst extends BrianMitchell implements IMC
{
    if (online != true)
        System.out.println("TEL - 202.275.5577 || FAX - 202.275.5092");

    else
        System.out.println("
            company  = http://www.imc.com &&
            personal = http://www.esva.net/~mitchell/ &&
            e-mail   = bmitchell@imc.com || mitchell@esva.net ");
}





                 reply	other threads:[~1998-08-24 13:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='c=US%a=_%p=VA%l=VBAVACO2-980820145126Z-11598@mail.va.gov' \
    --to=imcbmitc@vba.va.gov \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox