db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: RFD: RecordMappers, Peers and MapBuilders
Date Mon, 16 Jul 2012 19:14:10 GMT
On 16.07.12 09:44, Thomas Fox wrote:
> Am I right that you are addressing two different points here ?
> 1) Whether or not we need the Peer, RecordMapper and MapBuilder classes as
> different classes ?
> 2) Whether or not to generify the BasePeerImpl class ?

The general goal was simplification, but basically, yes.

> So, when there was the wish to concentrate the explicit database
> information, I'd concentrate it in the peer class and not in the
> RecordMapper class (as there is not yet this info, and it also is not the
> meaning of the class).

I agree. I didn't want to propose a specific implementation. I just
noticed that
- we generate up to 12 classes per table (BaseXXX, XXX, BaseXXXPeer,
XXXpeer, BaseXXXPeerImpl, XXXPeerImpl, BaseXXXRecordMapper
XXXRecordMapper, BaseXXXManager, XXXManager, XXXMapBuilder and XXXBean)
- I wanted to simplify the LargeSelect interface and found that no
single class provided all the information I needed.

So I thought we should think about reducing complexity (for the user,
that is) and the sheer number of classes to be generated.

> There is no hard reason I am aware of why we can not concentrate all
> functionality in one class. The main soft reason is that we now have a nice
> separation of concerns in different classes. On the other hand,
> concentrating the classes would mean a simpler class structure. My tendency
> would be to leave the class structure as it is, but I'd also be ok with a
> different decision.

I'd like to vote for a simpler class structure. If I understand your
concept correctly, it should be no problem to concentrate the generated
code into one or two classes.

> 2) Considering the generics part, I need to play around a bit. I am using
> generics only in simple ways on a daily basis and need to get familiar with
> the more complicated possibilities. I agree that there could be the
> possibility to move generated code into the base classes.
> I Will try to play around with generics a bit in the next time (i.e. weeks,
> likely) and come back with my findings. In principle, generifying
> BasePeerImpl seems to be a good idea, so if you want to have a shot, please
> do so.

I'll go on vacation this week. I'll take my notebook with me anyway, so
I might find some time.

Bye, Thomas.

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message