Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
- Subject: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
- From: Scott Ahten <email@hidden>
- Date: Thu, 6 Jan 2005 11:00:58 -0500
On Jan 6, 2005, at 2:48 AM, mmalcolm crawford wrote:
It's certainly not offending me, and I'm enjoying it too. I wish I had
more time to contribute at more than just a superficial level, but
unfortunately it would demand more thought time than I'm able to
devote at the moment.
Yes, this is a very interesting thread....
On Jan 4, 2005, at 5:28 AM, Izidor Jerebic wrote:
Again, after the object model is built according to domain
requirements, it is substantial work to have it support KVO, if it
does not fit already.
...
So I do not claim that there are some immovable requirements for
KVC/KVO. I am just stating that KVC/KVO interferes with your design
choices, and that it may be bad for some situations, notably those
that have complex object behaviour (note that those are the ones I
consider real OO designs - the rest is just relational scheme of data,
no behaviour).
Again, I'm relatively new to bindings, but I think of a bound object as
a model object who's state is observed and updated, not as a receiver
for messages based on it's domain.
Sending 'add' message to a calculator object asks it to perform an
addition. When used in this context, I don't think of the object as a
model as defined by MVC, but a object performing an domain operation.
Armed with the knowledge of how bindings works, you can craft key-paths
that may cause certain domain messages to be sent to bound objects, but
these messages are not arbitrary and are a side-effect of how bindings
work. Depending on the object, bindings may not even use an accessor to
observe or update the value, since it can accessing an instance
variable directly if present.
You can look at an instance of a calculator class as model, but this
would be to observe or update it's state, such as the number of decimal
points results will be rounded to, or possibly the result of it's last
calculation. Using bindings doesn't mean that bound objects can't
respond to domain messages, but that bindings are typically not a
source of these messages. Model objects don't have to be dictionaries,
they can be a facade that use a complex network of objects to define
it's state, use other objects to derive calculated values, etc.
As to whether Cocoa Bindings are OO, aren't bound objects essentially
delegates that, through implementation of KVC / KVO, return and receive
value objects base on key-value paths? Does the fact that key-value
paths can't represent any arbitrary Objective-C message prevent it from
being OO? Based on some strict definitions of OOP, languages such as
Javascript (which allow arbitrary methods to be called on objects) are
not OOP since they do not support inheritance or polymorphism.
Interface Builder actions let you send messages to objects, but they
are not completely arbitrary. The sender parameter is always the object
who action is invoked (you can't use a primitive value or other object
in it's place) nor can the result of the message be returned to the
sender. Do these limitations make IB Actions non-OO?
- Scott
- -
:: email@hidden
:: http://www.pixelfreak.net
- -
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Tim Lucas <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: mmalcolm crawford <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: mmalcolm crawford <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Charlton Wilbur <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Charlton Wilbur <email@hidden>) |
| >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>) |