cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øyvind Harboe <>
Subject Re: Cayenne 3.1 - how to create autoadapter
Date Fri, 11 Feb 2011 09:45:23 GMT
On Thu, Feb 10, 2011 at 3:55 PM, Andrus Adamchik <> wrote:
> There is a new constructor for AutoAdapter:
>   public AutoAdapter(Provider<DbAdapter> adapterProvider)

How do I create a Provider<DbAdapter>?

I searched for examples in the Cayenne code, but what
I found was in the DefaultDbAdapterFactory and I was
not able to trace that back to anything that I could call.

Is it just me or is it harder to search Cayenne code in e.g. Eclipse
when injection is used? I think I had more success using
the Cayenne source code as documentation,
before injection entered the picture.

>> While injection is an implementation detail, it is used in the
>> documentation:
> We are still trying to write the Java classes managed via
> injection in a manner that should not prevent their creation
> in the code.

A word of wisdom from K&R comes to mind:

'simple things should be simple and hard things possible'

Except for the deprecated methods, I think I've finished
porting to Cayenne 3.1 though! Some nice new features
allowed me to delete code. Always nice!

Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

View raw message