home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!keele!seq1.kl.ac.uk!csd05
- From: csd05@seq1.kl.ac.uk (Yufan Hu)
- Newsgroups: comp.object
- Subject: dynamic vs static method declaration
- Message-ID: <4041@keele.keele.ac.uk>
- Date: 9 Sep 92 11:26:54 GMT
- Sender: csd05@seq1.keele.ac.uk
- Reply-To: csd05@seq1.kl.ac.uk (Yufan Hu)
- Organization: University of Keele, England
- Lines: 43
-
- Hi, there,
-
- I have some problems with implementing a persistent object base. Could
- some people kindly hel me to clear them out?
-
- Background: Implementation of a persistent object base, with objects, classes
- and methods all persistent. The method to a message is lookup
- dynamically at run time.
-
- When a class is defined, I know there are at least two ways to declare
- methods (or the interface) of the class. One is to include all method
- declarations statically in the class definition, such as what is
- done in C++. The another one is to dynamically add methods to a
- class after the class is created, such as in Smalltalk-80.
-
- Questions:
- 1. Is there any other ways of declaring methods for a class? Please
- give the references.
- 2. Can you help me to find out any advantages and disadvantages of
- these methods?
- 3. Could you please point out any references to this problem?
-
- Tuitionally I would choose the dynamic one because I believe it is more
- flexible. But if methods are dynamically added to a class:
-
- 1. Does this break any "law" of object-orientness (data abstraction?
- encapsulation? information hidding? inheritance?).
-
- 2. Can any existing behaviours be changed after a new method is added?
- Please give a example.
-
-
- Thank you very much for your help. Please answer via e-mail, I will post
- a summery.
-
- -Yufan
- ==============================================================================
- JANET : yufan@uk.ac.keele.cs || Yufan Hu
- BITNET: yufan%cs.kl.ac.uk@ukacrl || Dept. of Computer Science, Univ. of Keele,
- other : yufan@cs.keele.ac.uk || Keele, Staffordshire. ST5 5BG. U.K.
- ------------------------------------------------------------------------------
- Telephone: +44-782-621111 x 7357 FAX: +44-782-713082
- ==============================================================================
-