Re: Framework EOModel Question
Re: Framework EOModel Question
- Subject: Re: Framework EOModel Question
- From: Chuck Hill <email@hidden>
- Date: Wed, 3 Aug 2005 21:44:02 -0700
On Aug 3, 2005, at 9:20 PM, LD wrote:
Hi there,
On 03/07/2004, at 6:11 AM, Hunter Hillegas wrote:
On Jul 2, 2004, at 1:01 PM, Chuck Hill wrote:
On Jul 2, 2004, at 12:52 PM, Hunter Hillegas wrote:
I have a question regarding EOModels in reusable frameworks...
So, if you plan to write a framework that contains EOs and you plan
to re-use it in many applications... How do you usually manage the
EOModel? Since the database will be different for each
application... What is the best practice here?
Keep the DB connection information in a properties file at the app
level. Update the models automatically on load. See code on
www.wocode.com or in Project WONDER for this.
Right on. For anyone else looking, here is the URL:
http://wocode.com/cgi-bin/WebObjects/WOCode.woa/wa/ShareCodeItem?
itemId=216
That's helpful... but how do you create a framework that will make
sure a specific db plugin framework, for example, is utilised when
included in a project (that should be agnostic about the underlying
db)?
Simple, you don't. :-) The framework is db agnostic. The application
(or classpath at least) can't be. Loading prototypes and the
connection dictionary at runtime will allow your framework and
application to run with multiple databases. But at runtime you either
have to ensure the correct plugin is on the classpath or load them all.
Which amounts to the same thing, I guess. Frameworks can't control
the application's classapath beyond the jar files contained in the
framework. You could, I suppose, embed the jar files for all possible
plugins in your framework. Imagine how much fun keeping that system
updated will be!
I've built a framework that has the EOModels and the
EOEnterpriseObjects for these. I'm currently using a
PostgreSQLPlugin.framework but aren't sure about how make sure this
framework is referenced when my model framework is included in a
project. Any ideas?
The app doesn't need to reference that framework specifically, just the
plugin for the database in use.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden