home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.smalltalk
- Path: sparky!uunet!munnari.oz.au!metro!cs.uow.edu.au!humm
- From: humm@cs.uow.edu.au (Bernhard G Humm)
- Subject: Re: get/set behaviour (was: >>Voluntary method typing)
- Message-ID: <1993Jan28.004755.1438@cs.uow.edu.au>
- Organization: Dept of Computer Science, Wollongong University, Australia
- References: <1993Jan27.001832.10017@cs.uow.edu.au> <1993Jan27.132905.3865@heeg.de> <knight.728144758@cunews>
- Date: Thu, 28 Jan 1993 00:47:55 GMT
- Lines: 44
-
- knight@mrco.carleton.ca (Alan Knight) writes:
-
- >The distinction is quite clear from the original post. It says
- >"database-type objects which _just_ have get/set behaviour". Clearly
- >objects have a record structure internally, but they also may provide
- >a great deal of additional behaviour beyond just setting and getting
- >the state of instance variables. I believe the original author was
- >referring to objects which do not provide any additional behaviour and
- >are thus very much like objects n a database or a "normal" language.
-
- No, you missed my point (and I didn't make it too clear I have to admit).
- I am well aware that in an OO language methods can do more that get and
- set internal variables, they can e.g. send messages to other objects. What
- I want to say is:
-
- The OO paradigm in its pure form is state based: the state of a system is
- based on the state of all its objects only and the state of an object is
- based on the values of its variables. And the only way of changing variables
- is setting them. So, whatever a method might do its effect has to somehow
- change object state.
-
- This is one extreme end of a spectrum. The pure functional paradigm is at
- the other end. In purely functional languages there are no variables at all,
- only parameters to function calls. The ``state'' of a system is determined
- by invocation stacks and the parameters being passed.
-
- ``Real programming'' is neither purely OO nor purely functional. But if you
- take a purist's view, the only thing that really counts is get/set, whatever
- a method does in-between.
-
-
- >There is also the issue that in an OO language it is not necessary to
- >provide these get/set methods, so the internal state of an object may
- >not be (entirely) visible to code not part of that object. e.g.
- > ...
-
- Well, I suppose you are aware that encapsulation (one of the features of OO)
- says that internal object state is NEVER visible to any outside code.
-
- --
- ________________________________________________________
- Bernhard G. Humm (humm@cs.uow.edu.au)
- Telecommunications Software Research Centre
- Department of Computer Science, University of Wollongong
-