Re: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-26 Thread Benjamin Stiglitz
> To implement the proposed interface, one cannot solely use bindings to
> accomplish this w/o modeling the intermediary join table.  The relationship
> management is instead accomplished via code (through NSSets and so on as per
> mmalc's example).

Correct; not with a straight tableview. You can generate NSSets based on
the table, set up dependent keys and bind to those.

-Ben
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-26 Thread Jon C. Munson II
Namaste!

I've taken a good look at mmalc's ToManyCheckbox example (thank you for
that).

I'd like some confirmation on what I believe to be true after the research
I've done so far to make sure I didn't miss something.

Given:  Entity A and Entity B have a many-to-many relationship with each
other, an NSTableView with a popup button to select appropriate Entity Bs
for Entity A will be used for an interface from Entity A's point of view.

To implement the proposed interface, one cannot solely use bindings to
accomplish this w/o modeling the intermediary join table.  The relationship
management is instead accomplished via code (through NSSets and so on as per
mmalc's example).

Is this correct thinking?

Thanks!

Peace, Love, and Light,

/s/ Jon C. Munson II


> -Original Message-
> From: cocoa-dev-bounces+jmunson=his@lists.apple.com [mailto:cocoa-dev-
> bounces+jmunson=his@lists.apple.com] On Behalf Of Jon C. Munson II
> Sent: Thursday, March 26, 2009 9:36 AM
> To: 'Melissa J. Turner'
> Cc: 'Cocoa Developers'
> Subject: RE: Implementing a many-to-many ("reflexive") relationship using
> bindings and an NSTableView
> 
>  [Jon C. Munson II]  OK.  Benjamin Stiglitz responded suggesting I take a
> look at the ToManyCheckbox example on mmalc's page, so I'll do that and
> see
> if that clarifies things.  Also, I noticed in the iClass example that code
> is used to support the relationship and so on.  Is that the recommended
> "template" implementation to support this type of relation?
> 
> The purpose of the iClass example is to demonstrate how to construct and
> maintain relationships between objects in different persistent stores.
> 
> Anything not required for that particular task is mostly an example of how
> to hack an example together in an afternoon under a deadline ;-)
> 
> [Jon C. Munson II] Is there then a more discrete example that illustrates
> an
> interface such as I'm attempting to implement?  If not, is there a way to
> request one?
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com
> 
> This email sent to jmun...@his.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-26 Thread Jon C. Munson II
 [Jon C. Munson II]  OK.  Benjamin Stiglitz responded suggesting I take a
look at the ToManyCheckbox example on mmalc's page, so I'll do that and see
if that clarifies things.  Also, I noticed in the iClass example that code
is used to support the relationship and so on.  Is that the recommended
"template" implementation to support this type of relation?

The purpose of the iClass example is to demonstrate how to construct and
maintain relationships between objects in different persistent stores. 

Anything not required for that particular task is mostly an example of how
to hack an example together in an afternoon under a deadline ;-)

[Jon C. Munson II] Is there then a more discrete example that illustrates an
interface such as I'm attempting to implement?  If not, is there a way to
request one?


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Melissa J. Turner


On Mar 25, 2009, at 13:44, Jon C. Munson II wrote:


[Jon C. Munson II]  OK.  Benjamin Stiglitz responded suggesting I  
take a
look at the ToManyCheckbox example on mmalc's page, so I'll do that  
and see
if that clarifies things.  Also, I noticed in the iClass example  
that code
is used to support the relationship and so on.  Is that the  
recommended

"template" implementation to support this type of relation?


The purpose of the iClass example is to demonstrate how to construct  
and maintain relationships between objects in different persistent  
stores.


Anything not required for that particular task is mostly an example of  
how to hack an example together in an afternoon under a deadline ;-)


+Melissa

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Keary Suska

On Mar 25, 2009, at 2:44 PM, Jon C. Munson II wrote:


Do you mean here that you will "pop up" a window that contains an
NSTableView that will be used to select rows of Entity B? Correct
language is critical. I think most Cocoa developers would assume that
"popup" means NSpopupButton.



[Jon C. Munson II] Yes, an NSPopupButton is what I meant to imply  
here.


How would you do that? A popup button may only represent a single  
value. If you need to represent multiple values, you will need  
something like mmalc's the checkboxes example or a table view.



You should be able to use bindings for everything you describe except
for setting relationships between existing objects. That will have to
be done in code, AFAIK, but isn't difficult.

[Jon C. Munson II]  OK.  Benjamin Stiglitz responded suggesting I  
take a
look at the ToManyCheckbox example on mmalc's page, so I'll do that  
and see
if that clarifies things.  Also, I noticed in the iClass example  
that code
is used to support the relationship and so on.  Is that the  
recommended

"template" implementation to support this type of relation?


You might be able to use an array controller whose content is the to- 
many relationship, calling addObject: with the managed object to add  
to the relationship, but otherwise the controller wouldn't interact  
with the UI. At that rate, it is probably better to set the  
relationship in code.


Generally, inserting new objects into a to-many relationship using an  
array controller is a common method.


HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Jon C. Munson II
> 
> On Mar 25, 2009, at 7:47 AM, Jon C. Munson II wrote:
> 
> > Two entities, one named A, the other named B.  A and B have a
> > reflexive
> > relationship with each other (that would be a many-to-many type).  The
> > backend is a SQLite store (not that it should matter).
> 
> To be clear, a reflexive relationship is when an entity had a
> relationship to *itself*. That's a different animal than a vanilla
> many-to-many, which is what you seem to be describing.
>
[Jon C. Munson II] Sorry, I misinterpreted the docs on that one.  This is a
plain vanilla many-to-many relationship.
 
> > I'd like my interface to be based from entity A's point of view,
> > using an
> > NSTableView to select (via popup) the entity B's that are related
> > (populating the popup with values is not at issue).
> 
> Do you mean here that you will "pop up" a window that contains an
> NSTableView that will be used to select rows of Entity B? Correct
> language is critical. I think most Cocoa developers would assume that
> "popup" means NSpopupButton.
> 

[Jon C. Munson II] Yes, an NSPopupButton is what I meant to imply here.

> > So, my question is therefore how do I configure the bindings to
> > support the
> > relationship if it is even possible to use bindings solely?  If it
> > isn't
> > possible to use bindings, is there a discrete example somewhere that
> > someone
> > could point me to that shows how to set this up?
> 
> You should be able to use bindings for everything you describe except
> for setting relationships between existing objects. That will have to
> be done in code, AFAIK, but isn't difficult.
> 

[Jon C. Munson II]  OK.  Benjamin Stiglitz responded suggesting I take a
look at the ToManyCheckbox example on mmalc's page, so I'll do that and see
if that clarifies things.  Also, I noticed in the iClass example that code
is used to support the relationship and so on.  Is that the recommended
"template" implementation to support this type of relation?

Thanks!

/s/ Jon C. Munson II

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Benjamin Stiglitz
> 
> For the sake of this discussion, here's a sample entity layout:
> 
> Two entities, one named A, the other named B.  A and B have a reflexive
> relationship with each other (that would be a many-to-many type).  The
> backend is a SQLite store (not that it should matter).
> 
> I'd like my interface to be based from entity A's point of view, using an
> NSTableView to select (via popup) the entity B's that are related
> (populating the popup with values is not at issue). 
> 
> My issue comes in with how to set the bindings to support the relationship.


Take a look at Malcom Crawford’s very handy page of bindings examples:


ToManyCheckbox is probably most interesting to you.

-Ben
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Keary Suska


On Mar 25, 2009, at 7:47 AM, Jon C. Munson II wrote:

Two entities, one named A, the other named B.  A and B have a  
reflexive

relationship with each other (that would be a many-to-many type).  The
backend is a SQLite store (not that it should matter).


To be clear, a reflexive relationship is when an entity had a  
relationship to *itself*. That's a different animal than a vanilla  
many-to-many, which is what you seem to be describing.


I'd like my interface to be based from entity A's point of view,  
using an

NSTableView to select (via popup) the entity B's that are related
(populating the popup with values is not at issue).


Do you mean here that you will "pop up" a window that contains an  
NSTableView that will be used to select rows of Entity B? Correct  
language is critical. I think most Cocoa developers would assume that  
"popup" means NSpopupButton.


So, my question is therefore how do I configure the bindings to  
support the
relationship if it is even possible to use bindings solely?  If it  
isn't
possible to use bindings, is there a discrete example somewhere that  
someone

could point me to that shows how to set this up?


You should be able to use bindings for everything you describe except  
for setting relationships between existing objects. That will have to  
be done in code, AFAIK, but isn't difficult.


Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Implementing a many-to-many ("reflexive") relationship using bindings and an NSTableView

2009-03-25 Thread Jon C. Munson II
Namaste!

For the sake of this discussion, here's a sample entity layout:

Two entities, one named A, the other named B.  A and B have a reflexive
relationship with each other (that would be a many-to-many type).  The
backend is a SQLite store (not that it should matter).

I'd like my interface to be based from entity A's point of view, using an
NSTableView to select (via popup) the entity B's that are related
(populating the popup with values is not at issue). 

My issue comes in with how to set the bindings to support the relationship.


I've taken a look at the iClass example (which did give me some basics from
which to work) and also the Core Recipes example - neither implement the
interface in the manner I'd like.

I also did a lot of Googling on the terms "cocoa core data reflexive
bindings many-to-many" (and a couple others) in attempts to try and find a
similar solution.

I did find some nice discussions (rather old though) from mmalc (whose
examples I also perused), however they weren't oriented with my intended
solution.

So, my question is therefore how do I configure the bindings to support the
relationship if it is even possible to use bindings solely?  If it isn't
possible to use bindings, is there a discrete example somewhere that someone
could point me to that shows how to set this up?

Many thanks in advance?

Peace, Love, and Light,

/s/ Jon C. Munson II



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com