Re: invoking a method



Now that one really does have me curious Pete. Care to go on with the
subject a bit more length?

I tend to make almost every property private just so that I can hide the
implementation of it. I usually generate a class that I use to pass the data
as well. Works great in my world. In procedural parlance, I can publish an
API and change the implementation behind it as many times as I wish without
disturbing other people using it. Indeed, it may be that I am misusing
properties in some way, but that has always seemed the most logical and
correct way to implement them - since way back in the early 1980's at least.

-Paul

"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4th387F145bllU1@xxxxxxxxxxxxxxxxxxxxx
Thanks for the comments, Paul.

I should have made it clear that I was describing what I consider to be
personal "best practice" and not necessarily what can actually be done.

I know GET and SET methods can be used to manipulate private properties,
but I don't do that. If I want things manipulated I make them public...
:-)

Pete.

TOP POST - nothing new below


"P. Raulerson" <paul.rl@xxxxxxxxxxxxxx> wrote in message
news:ZIFch.11140$YI1.4490@xxxxxxxxxxxxxxx
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: invoking a method
    ... integer to a string and add it to another string. ... interface Class provides these methods and saves you the trouble of ... Fujitsu Object COBOL environment (You could simulate it very easily ... the same as "inserting" it... ...
    (comp.lang.cobol)
  • RE: Asking again - ResultSet.getString() & unicode
    ... Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ... I can get the unicode string correctly from sqlserver. ... T-SQL, when we inserting unicode string, it's recommended that we add "N" ...
    (microsoft.public.sqlserver.odbc)
  • RE: Asking again - ResultSet.getString() & unicode
    ... > I can get the unicode string correctly from sqlserver. ... Also, for inserting, ... > Microsoft Online Support ...
    (microsoft.public.sqlserver.odbc)
  • Re: Closing a Database connection
    ... Because if there is a unique constraint on the first field, you are bound to have an error when inserting a second record. ... Public Function Firstrecord(ByVal userid As String, ... Dim todaynumber As String ... 'This is used to setup the connection string to write the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: how to get the id of the inserted datarow?
    ... after inserting a row, I want to return the id of the inserted row. ... This id could be a number or a string. ... AddProperIdValue(tableName, columnValues, idName, ... DataRow dataRow = dataTable.NewRow; ...
    (microsoft.public.dotnet.framework.adonet)