Re: Framework EOModel Question
Re: Framework EOModel Question
- Subject: Re: Framework EOModel Question
- From: Kieran Kelleher <email@hidden>
- Date: Thu, 4 Aug 2005 09:20:45 -0400
Project Wonder has this done for you and you can either use it or adopt
the strategy.
Look at the ERPrototypes framework in PW. It has different prototypes
for each database vendor. If you use ERPrototypes for your prototypes,
then you can select which EOPrototypes are used using properties in the
Properties file. See the HowTo in the Documentation group of the
ERPrototypes framework for further info.
You can also configure properties (either global for all models or
different sets for each EOModel) for connection URL's, user, password,
driver, etc. even different database-specific EOPrototypes for each
model. PW automatically configures all models for you intelligently
based on which properties you have put in your Properties file. To see
the comprehensive set of EOModel properties and the property syntax for
each one just look at the source (yes, look at the source ... great to
have it, isn't it?!) in ERExtensions framework in the class
ERXConfigurationManager and its resetConnectionDictionaryInModel()
method.
properties might look like this if you have two models named
ERCoreBusinessLogic.eomodeld and cheetah.eomodeld
ERCoreBusinessLogic.URL =
jdbc:mysql://mysqlserver/ercore?capitalizeTypenames=true
ERCoreBusinessLogic.DBUser = ercore_app
ERCoreBusinessLogic.DBPassword = a_password
ERCoreBusinessLogic.DBDriver =
ERCoreBusinessLogic.DBPlugin =
ERCoreBusinessLogic.DBJDBCInfo =
cheetah.URL = jdbc:mysql://other_server/cheetah?capitalizeTypenames=true
cheetah.DBUser = a_user
cheetah.DBPassword = another_password
cheetah.DBDriver =
cheetah.DBPlugin =
cheetah.DBJDBCInfo =
On Aug 4, 2005, at 2:15 AM, LD wrote:
Hi there,
On 04/08/2005, at 2:44 PM, Chuck Hill wrote:
On Aug 3, 2005, at 9:20 PM, LD wrote:
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!
The framework isn't db agnostic (currently) because the EOModels in
the framework are currently tied to postgres specific column attribute
types. Any tips on making the models db agnostic?
I'm utilising the postgres 'serial' type for auto-incrementing primary
keys... then there's timestamp types and so on...
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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