FROM : Charlton Wilbur
DATE : Fri Apr 08 18:34:22 2005
On Apr 8, 2005, at 11:17 AM, Shawn Erickson wrote:
> The definition of object-oriented or object appears to be (and is) a
> rather subjective thing... having accessors can been seen as exposing
> what is in an object which some consider to be very much unobject like
> (one very small step from a structure, yeah yeah I know you inject
> logic in accessor, etc. so they don't really have to expose the
> internals) similar things can be said about NSManagedObjects
> interface, and on and on.
Well, that's the thing -- you don't *know* whether [employee name] is
exposing an instance variable, or making a database call, or
calculating a value. The sensible implementation in most cases is to
expose an instance variable, but that's not required. And the same
thing is true of [employee valueForKey: @"name"].
The last time we had a similar discussion on object-oriented orthodoxy,
I demonstrated fairly clearly that Objective-C messages and key-value
coding are isomorphic ways of communicating with an object. There is
nothing you cannot do with key-value coding that you cannot also do
with messages, and there is nothing you cannot do with messages that
you cannot also do with key-value coding. As such, preference between
key-value coding and message sending cannot logically be about
expressive power or capability unless that isomorphism is refuted (and
it was not in the prior thread); it must be about performance and
aesthetics.
Claim that you do not *like* KVC, and I won't quibble. Claim that it's
slower than message sending, and I won't quibble. Claim that there are
more elegant ways of accomplishing some things, and I won't quibble on
substance though I may disagree on particular instances. Hell, you can
even claim that Apple isn't using the power of KVC to its fullest -- I
certainly won't disagree on that! But don't try to portray aesthetic
preference as an absolute good, especially when your aesthetic
preference shifts work from the computer to the programmer.
> So I think this side of the discussion is pedantic... it is better to
> say you prefer a particular style of interface to your model data and
> leave the talk of object-oriented, objects, and messages out of it...
> since NSManagedObject is an object in the Objective-C sense, it
> encapsulates data, it supports messaging to get at this data, etc.
My suspicion here is that the people who are claiming that KVC is _ipso
facto_ not object-oriented are cleaving to a particular ideal of
aesthetic purity, and aesthetic purity is the first thing to be
sacrificed when a concept leaves the laboratory. The real world is
complicated and messy and does not lend itself to orthodoxy.
Charlton
--
Charlton Wilbur
<email_removed>
<email_removed>
<email_removed>
DATE : Fri Apr 08 18:34:22 2005
On Apr 8, 2005, at 11:17 AM, Shawn Erickson wrote:
> The definition of object-oriented or object appears to be (and is) a
> rather subjective thing... having accessors can been seen as exposing
> what is in an object which some consider to be very much unobject like
> (one very small step from a structure, yeah yeah I know you inject
> logic in accessor, etc. so they don't really have to expose the
> internals) similar things can be said about NSManagedObjects
> interface, and on and on.
Well, that's the thing -- you don't *know* whether [employee name] is
exposing an instance variable, or making a database call, or
calculating a value. The sensible implementation in most cases is to
expose an instance variable, but that's not required. And the same
thing is true of [employee valueForKey: @"name"].
The last time we had a similar discussion on object-oriented orthodoxy,
I demonstrated fairly clearly that Objective-C messages and key-value
coding are isomorphic ways of communicating with an object. There is
nothing you cannot do with key-value coding that you cannot also do
with messages, and there is nothing you cannot do with messages that
you cannot also do with key-value coding. As such, preference between
key-value coding and message sending cannot logically be about
expressive power or capability unless that isomorphism is refuted (and
it was not in the prior thread); it must be about performance and
aesthetics.
Claim that you do not *like* KVC, and I won't quibble. Claim that it's
slower than message sending, and I won't quibble. Claim that there are
more elegant ways of accomplishing some things, and I won't quibble on
substance though I may disagree on particular instances. Hell, you can
even claim that Apple isn't using the power of KVC to its fullest -- I
certainly won't disagree on that! But don't try to portray aesthetic
preference as an absolute good, especially when your aesthetic
preference shifts work from the computer to the programmer.
> So I think this side of the discussion is pedantic... it is better to
> say you prefer a particular style of interface to your model data and
> leave the talk of object-oriented, objects, and messages out of it...
> since NSManagedObject is an object in the Objective-C sense, it
> encapsulates data, it supports messaging to get at this data, etc.
My suspicion here is that the people who are claiming that KVC is _ipso
facto_ not object-oriented are cleaving to a particular ideal of
aesthetic purity, and aesthetic purity is the first thing to be
sacrificed when a concept leaves the laboratory. The real world is
complicated and messy and does not lend itself to orthodoxy.
Charlton
--
Charlton Wilbur
<email_removed>
<email_removed>
<email_removed>
| Related mails | Author | Date |
|---|---|---|
| mmalcolm crawford | Apr 5, 17:33 | |
| Philip Mötteli | Apr 5, 23:49 | |
| Guy English | Apr 6, 00:29 | |
| Scott Stevenson | Apr 6, 01:14 | |
| Dustin Voss | Apr 6, 02:18 | |
| James Duncan David… | Apr 6, 02:27 | |
| Jake Macmullin | Apr 6, 02:31 | |
| John C. Randolph | Apr 6, 02:55 | |
| James Duncan David… | Apr 6, 03:01 | |
| Ondra Cada | Apr 6, 04:04 | |
| Will Mason | Apr 6, 04:48 | |
| Rogelio M.Serrano… | Apr 6, 06:05 | |
| Rogelio M.Serrano… | Apr 6, 06:06 | |
| mmalcolm crawford | Apr 6, 07:46 | |
| Paul Szego | Apr 6, 08:22 | |
| mmalcolm crawford | Apr 6, 09:52 | |
| ?????Andre? | Apr 6, 09:55 | |
| Ondra Cada | Apr 6, 12:21 | |
| oplus | Apr 6, 12:32 | |
| Mont Rothstein | Apr 6, 12:36 | |
| Philip Mötteli | Apr 6, 14:47 | |
| Scott Stevenson | Apr 6, 18:00 | |
| mmalcolm crawford | Apr 6, 18:39 | |
| Nat! | Apr 6, 22:35 | |
| mmalcolm crawford | Apr 6, 23:47 | |
| Timothy Reaves | Apr 7, 00:25 | |
| mmalcolm crawford | Apr 7, 00:50 | |
| Shawn Erickson | Apr 7, 01:05 | |
| James Duncan David… | Apr 7, 01:28 | |
| Todd Blanchard | Apr 7, 06:37 | |
| Todd Blanchard | Apr 7, 06:41 | |
| Scott Stevenson | Apr 7, 06:59 | |
| Philip Mötteli | Apr 7, 08:32 | |
| Marcel Weiher | Apr 7, 11:59 | |
| Charlton Wilbur | Apr 7, 15:11 | |
| Mike Ferris | Apr 7, 16:53 | |
| Marcel Weiher | Apr 7, 16:55 | |
| Marco Scheurer | Apr 7, 17:55 | |
| Marcel Weiher | Apr 7, 19:13 | |
| Scott Stevenson | Apr 7, 19:55 | |
| Marcel Weiher | Apr 7, 21:03 | |
| Mike R. Manzano | Apr 7, 21:21 | |
| Timothy Reaves | Apr 7, 22:03 | |
| Evan DiBiase | Apr 7, 22:28 | |
| Marcel Weiher | Apr 7, 22:35 | |
| mmalcolm crawford | Apr 7, 23:05 | |
| ttempel | Apr 8, 01:50 | |
| Paul Szego | Apr 8, 11:50 | |
| Johnny Deadman | Apr 8, 14:10 | |
| Philippe Mougin | Apr 8, 16:52 | |
| Shawn Erickson | Apr 8, 17:07 | |
| Shawn Erickson | Apr 8, 17:17 | |
| Ralph Scheuer | Apr 8, 17:28 | |
| Ralph Scheuer | Apr 8, 17:32 | |
| John Brownlow | Apr 8, 17:47 | |
| Charlton Wilbur | Apr 8, 18:34 | |
| Scott Stevenson | Apr 8, 18:43 | |
| Ralph Scheuer | Apr 8, 19:03 | |
| Philippe Mougin | Apr 8, 20:37 | |
| Scott Ellsworth | Apr 8, 21:46 | |
| Scott Ellsworth | Apr 8, 21:48 | |
| Evan DiBiase | Apr 8, 22:16 | |
| mmalcolm crawford | Apr 8, 22:30 | |
| mmalcolm crawford | Apr 8, 23:13 | |
| Marcel Weiher | Apr 9, 02:20 | |
| Marcel Weiher | Apr 9, 02:46 | |
| Scott Ellsworth | Apr 9, 09:39 | |
| Marcel Weiher | Apr 9, 09:44 | |
| Byron Ellis | Apr 9, 10:37 | |
| Marcel Weiher | Apr 9, 14:03 | |
| Charlton Wilbur | Apr 9, 16:01 | |
| ?????Andre? | Apr 9, 18:08 | |
| Scott Stevenson | Apr 9, 18:24 | |
| Scott Stevenson | Apr 9, 18:27 | |
| Marcel Weiher | Apr 10, 00:06 | |
| Marcel Weiher | Apr 10, 00:16 | |
| Marcel Weiher | Apr 10, 00:38 | |
| ?????Andre? | Apr 10, 01:03 | |
| Charlton Wilbur | Apr 10, 01:13 | |
| mmalcolm crawford | Apr 10, 01:53 | |
| Scott Stevenson | Apr 10, 01:58 | |
| Todd Blanchard | Apr 10, 08:32 | |
| mmalcolm crawford | Apr 10, 08:52 | |
| mmalcolm crawford | Apr 10, 09:25 | |
| PA | Apr 10, 12:08 | |
| mmalcolm crawford | Apr 30, 10:18 |






Cocoa mail archive

