Ray,
Of course, there are things that are awkward about this also. A lot
of them have to do with the fact that the code for working in this
way is very concise in Objective C. Having translated this
mechanism to java, one has to do more casting and "grunt work" than
seems necessary.
I would tend to agree with you on this. Take Core Data for example,
where relationship results are sent back as NSSet rather than NSArray
which more accurately represents the unordered nature of the
objects. When binding those results to the UI you have an
"arrangedObjects" method for binding to table views and other various
UI controls. These ordered lists are then arranged by a set of "sort
descriptors." So I believe that you are correct in your assessment
that ordering the results should be a behavior of the view rather
than the model.
When working with WebObjects, one thing I miss from my recent Ruby on
Rails work is the "built-in" notion of "helper methods" for the
view. Rails handles this though Ruby's "Mix-in" construct, which is
very much like categories in Objective-C. The helper methods are
actually "mixed into" the controller, but are nicely separated into
separate modules since they exist solely to support view behavior.
On Apr 3, 2007, at 11:57 AM, Ray Kiddy wrote:
On Apr 3, 2007, at 7:59 AM, David Avendasora wrote:
Okay. I've given the method a new name and it is working perfectly
now. I'm assuming that this applies to filtering the array of
related objects as well. Yes?
BTW, did I miss something in the documentation where it tells you
not to override these? I have several WO books as well, and while
the examples always show using a separate method, they don't say
it's required.
I would suggest that you have an issue with separating your data
and your presentation. WebObjects is very much built to use Model-
View-Controller methodologies. If you think of your sorting problem
as a display issue, easier solutions may present themselves. I
think that this is why the EOSortOrdering functionality is so
abstract. It makes it easy to not sort until display time.
Of course, there are things that are awkward about this also. A lot
of them have to do with the fact that the code for working in this
way is very concise in Objective C. Having translated this
mechanism to java, one has to do more casting and "grunt work" than
seems necessary.
- ray
Thanks again for the help everyone!
On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:
Use a separate method instead of overriding the existing method.
There are assumptions made about the array returned via KVC, and
you are breaking those assumptions by reordering an array that
EOF thinks it owns.
_______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/robertwalker1%
40mac.com
This email sent to [EMAIL PROTECTED]
--
Robert Walker
[EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]