Re: invoking a method



Just a comment:
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4tftu9F13rndoU1@xxxxxxxxxxxxxxxxxxxxx

"getters and setters" typically refer to METHODS used to set a property, as
you so aptly described. However, there is nothing that says the properties
*must* be PUBLIC. Indeed, Getters and Setters are used to encapsulate the
format of private properties inside an object, and in specific, their
implementation.

Second, unlike is some of the Microsoft world, it is pretty common to pass
objects to ADD or INSERT methods and have the method determine what kind of
object is dealing with. "+" is usually used as an example of this - being
able to add two integers or concatenate two strings, or convert an integer
to a string and add it to another string. That kind of stuff. As you pointed
out, they are also regular parts of collections, and hide the underlying
implementation.

-Paul


<snip lots of good stuff here to get to the part I am commenting on ...>
(The SET method of the list object is implicit if it is a COM object (and
those are the ones I mainly deal with...) If it isn't, then you would need
to write (or generate) your own GET and SET methods) The Fujitsu COM
interface Class provides these methods and saves you the trouble of having
to wrap your .dll with the layers and interfaces you would otherwise need.
The use of SET as shown here, will not work outside the Fujitsu Object
COBOL environment (You could simulate it very easily though).

It's not a good example, because SET actually sets the property, which is
the same as "inserting" it... Any INSERT Method, presumably has something
to be inserted, so there will usually be further information required.

Something that might use an INSERT method could be a database object
(Collections use ADD)



.



Relevant Pages

  • Re: Get/Set vs Public Variables
    ... string firstname; ... EVER will need any functionality in getters and setters for the two string ... For example, if this was your typical business object, the name and last ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Get/Set vs Public Variables
    ... string firstname; ... EVER will need any functionality in getters and setters for the two string ... For example, if this was your typical business object, the name and last ...
    (microsoft.public.dotnet.languages.csharp)
  • Need expert advice on parsing a string into java beans
    ... I am having a hard time using recursion to parse the string back to the Java beans. ... private String address; // Setters and Getters} ...
    (comp.lang.java.programmer)
  • Re: OO in Python? ^^
    ... > getters and setters in Java? ... getters, then it makes sense to write setters and getters. ... insurance against you changing the private interface. ... > a hack in Python (common, "hiding" an implementation detail by prefixing ...
    (comp.lang.python)
  • Re: "Getter" methods no good?
    ... The fear is that if you have getters and setters on an object, then other objects are going to extract the private data of the object, do some processing on it and write it back. ... there are many cases where instance variables of an object are fundamental to the object's behavior and you need to be able to set them or get them. ... BTW, I wrote a physics simulator myself and found that the best algorithm to solve the physics equations was to extract the positions and velocities from the particles, store them into one big vector, run Adaptive Runge Kutta on the vector, then write all the data back. ...
    (comp.lang.smalltalk)