Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple instances of EOModel in an application.



On Jun 23, 2004, at 6:14 PM, Marek Wawrzyczny wrote:

Has anyone tried to concurrently use many instances of the same EOModel, linked to different databases in a single application?
We are evaluating this possibility. We have several identical databases which we'd hope to update using WebServices through a single WO app. All EOs have the same business logic. This app would ideally choose the right data source depending on the login info. As far as I can tell this is only possible if the none of the EO share the same entity name.

The restriction is that the names of all entities loaded into an EOModelGroup must be unique. All eomodels in an app and in any frameworks linked to the app are loaded into a single EOModelGroup. So you'd need to rename the entities in each identical eomodel so that all entity names are unique. I'm not certain, but I don't believe there'd be any problem with identical entities with different names sharing the same EO class.


Maybe you could devise an entity name suffix that's tied to the particular database being accessed. Then any entity name reference in your code could be a String that would be dynamically assigned the appropriate entity name based on the database being accessed.

This is all off the top of my head, so I've undoubtedly overlooked some critical detail that will blow this whole thing out of the water :-)

Aloha,
Art
_______________________________________________
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: 
 >Multiple instances of EOModel in an application. (From: Marek Wawrzyczny <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.