cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gmail <>
Subject Re: reverse engineering refactoring
Date Wed, 05 Oct 2016 00:51:15 GMT
Two suggestions and I'd be willing to help on any of this.

1) have the model "remember" which datasource was used to

2 it would be nice if the graph layouts for the data models actually used some kind of layout
algorithm to prevent the tables from being the mess that they are..

Tony Giaccone

> On Oct 3, 2016, at 2:57 PM, Andrus Adamchik <> wrote:
> You've probably seen tons of semi-random commits from me lately :)
> What I was trying to do is to bring some sanity into reverse-engineering and its plethora
of configurations, settings, strategies and flows. I am still not fully finished, but some
important steps are already complete:
> * Code related to reverse engineering backend was split from cayenne-server into its
own "cayenne-dbsync" module.
> * The most challenging part of was moving MergerTokenFactory, as factories are adapter-specific.
I came up with a few DI tricks to preserve per-adapter implementations. Long story short -
"merge" package is now in "cayenne-dbsync" as well.
> * Name generators for various model objects in various contexts were unified, heavily
refactored and placed in "cayenne-dbsync" as well. There are just 2 visible ones: NameBuilder
and ObjectNameGenerator. Both complement each other and are fairly easy to understand.
> * Removed most logic forks in our reverse engineering flow. Now regardless of whether
you do rev-eng from scratch, or merging into an existing DataMap, the sequence is pretty much
the same:
>  1. DbLoader reverse engineers the DB based on its filters into a temporary DataMap.
>  2. This DataMap contains only the DB layer. No ObjEntities.
>  3. Then we compare this DataMap with our target DataMap, generate MergerTokens and merge
> Now of the above is backwards compatible API-wise, but this is not the core API that
we absolutely need to preserve between releases. So I think this is not a problem. The only
visible incompatibility for an average user is this:
> Next I am going to pull some stuff from downstream cayenne-tools into cayenne-datasync
to make reverse engineering mechanism fully agnostic of the caller. There's probably more
cleanup to do around configurations, etc.
> After that going to finally fix a few rev-eng bugs that triggered this whole endeavor.
> Also we'll need to spend some time on the new rev-eng tab in the modeler. It kinda works,
but there are UI quirks, and simply lots of unused potential in how we can present the new
backend capabilities via the UI.
> Hope all this make sense :)
> Andrus

View raw message