• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Q: Views with EOF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: Views with EOF


  • Subject: Re: Q: Views with EOF
  • From: Jonathan Rochkind <email@hidden>
  • Date: Thu, 8 Apr 2004 11:28:58 -0500

First of all, I think choice 3 and 4 are basically the same as far as EOF is concerned. In both cases, you will have two entities which really point to the same underlying table (one through a view; one quite plainly to the same underlying table). If the same rows can exist in both entities, your main concern is with object graph consistency. That is, you have one EO, let's call it simpleEO of EntitySimple that represents the same db row as another, viewEO of EntityView. If you make changes to simpleEO, EOF isn't going to know those changes should apply to viewEO too---so even though they are really representing the same row, they could get out of synch. Which might also have implications for optimistic locking, as well as of course just for your application logic, and what gets shown to the users.

I can't think of any other problems than that consistency one, but I'm not sure if there are any other sub-problems that consistency problem might cause. And I don't think it makes a difference if it's possibility 3 or 4 below, I think both have pretty much exactly the same situation in regards to EO consistency. I'm not neccesarily saying you shouldn't do it, though; it should basically work subject to that limitation, if that's acceptable.

If you _didn't_ have the actual table exposed, and only had an entity pointing to the view---I think this would be fine. (So long as your db allows updates to views! Some do and some don't. Of course if it doesn't, than this view entity would have to be read-only). Likewise, if you _only_ had an entity with a restricting qualifier, and not another one pointing to the same table without a restricting qualifier---no problem.

--Jonathan

At 12:05 PM -0400 4/8/04, Arturo Pirez wrote:
Hi all,

Here's a question regarding views and EOF. I have an entity with a toMany relationship to some other entities. At this junction, I need to either
1) put in a filtering everywhere I traverse this relationship
2) make cover methods to run the SQL I need to filter these relationships
4) create a new entity with a restricting qualifier and relationship to that
3) Create views instead of tables to fulfull these relationships.


I much prefer method #3 over the others. However, I would like to approach this cautiously. Are there any gotchas in defining EOF relationships with views instead of tables?

Thanks in advance.
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Q: Views with EOF (From: Arturo PĂ©rez <email@hidden>)

  • Prev by Date: Q: Views with EOF
  • Next by Date: Re: Default entry field focus
  • Previous by thread: Q: Views with EOF
  • Next by thread: Cold Fusion to Webobjects tools
  • Index(es):
    • Date
    • Thread