You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Thomas Fischer <tf...@apache.org> on 2006/11/29 23:04:45 UTC
Torque 4.0 plan
Now that the first Torque RC is outit is time to think about what we'd
like
to do as next version. Personally, I'd like to propose the following:
- Next version should be 4.0. There can be major changes in the version,
but the 'look and feel' should change as little as possibl. The idea
would be that one can recompile one's Torque 3.2 or 3.3 project with the
new Torque version and it should run with minor changes only.
- Switch to Maven 2 as build system. Maven 2 has much better multiproject
support than Maven 1, so building will be easier.
- Simplify the repository structure: No svn externals any more. This would
mean that all Torque components can only be released simultaneously, but
as we have done so in the past anyway and compatibility problems would
arise if we would'nt do so, this should not be problematic.
- Use Java 5 style generics and enumerations. One can use compiler
settings to produce pre-1.5-executable class files.
- Kick out village. Village is bad. See the issue tracker for details.
This would mean: create the sql to insert / update objects ourselves; do
the Torque type / SQL type mapping of variables orselves; create objects
directly from jdbc result sets.
- Use the Criteria object only to hold query data and another object to
hold update data. Criteria should not extend Hashtable any more nor
sahould it implement the map interface, cause query data is not a Map in
any sense (e.g. the same column names can appear more than once in a
criteria)
- Criterias should not be modified any more inside queries. Of one needs
modification, one can copy the criteria.
- Disentangle Query description and SQL creation code. In my eyes, it
would be ideal to port the MVC paradigm to the SQL creation: The criteria
is the model (what do I want to query), the view would cretae the SQL from
the Query, and the controller would be the Peer class which executes the
query.
- Use a column object to hold the column name in the runtime instead of
Strings. So one could remove all that distributed guesswork of "what is
the table name, do we have a schema name or not" etc. This would also have
the advantge that a String is clearly a value and not a column name.
- Make the generator more generic. I'd like to turn the generator into a
generiy code generation tool, which can be used to create all sort of
code, not just database access code. I'm currently working on a proposal.
Any opinions ?
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Non-static Peers (was: Torque 4.0 plan)
Posted by Joe Carter <jo...@excite.com>.
Fine for that part - though a getBackend() would be useful.
You're right about "singleton" - we really want to use it as a factory class
for the peers rather than as a true singleton. We should definitely avoid
that term :-)
How about we follow the pattern Torque uses for the other generated classes
and have a generated BaseBackend and a class that extends that?
The extended class doesn't get overwritten on generation and is present to
allow extension.
Or is that overly complex?
Actually the same follows for the BasePeer. We've had a couple of occasions
where it would be been handy to extend at that level - e.g. to provide a
different
method to getConnection(). Actually the BasePeer is really a connection
manager
and some utils (I think!). Are these appropriately named? Should it be split
up?
Taking it even further you could really have a factory class providing the
backends
which implement an interface. Then the code is built against an interface
rather
that static methods. This would be a fairly significant departure for
existing codebases though
Cheers
Joe
On 02/12/06, Thomas Fischer <tf...@apache.org> wrote:
>
> Oops, I used the swear word "singleton" ... Fortunately, I probably
> misused it. I did not mean to enforce singleton behaviour, i.e. to forbid
> the existence of more than one instance. The static wrapper would be for
> ease of usage, the Backend class for those which do not want to use static
> method at all, and for the people in between, a setter to exchange the
> backend of the static class. I have appended some sample code.
>
> Would this be ok ? Any better suggestions ?
>
> Thomas
>
> The code would look as follows:
>
> public class SomePeer
> {
> private static SomePeerBackend backend;
>
> static
> {
> backend = new SomePeerBackend();
> }
>
> public static void setBackend(SomePeerBackend backend)
> {
> if (backend == null)
> {
> throw new NullPointerException();
> }
> this.backend = backend;
> }
>
> public static List doSelect(Criteria criteria)
> {
> return backend.doSelect(criteria);
> }
>
> ....
> }
>
> public class SomePeerBackend
> {
> /** Public constructor */
> public SomePeerBackend()
> {
> }
>
> public List doSelect(Criteria criteria)
> {
> // do select, return results
> ...
> }
>
> ...
> }
>
> On Fri, 1 Dec 2006, Joe Carter wrote:
>
> > On 30/11/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
> >>
> >> "Joe Carter" <jo...@excite.com> writes:
> >>
> >> >Personally I'd just have the singleton (snip...)
> >>
> >> If you think about a singleton, please separate the singleton class
> >> and the implementation class (don't have the static getInstance()
> >> method and a possible private C'tor in the implementation). If you
> >> separate these, it is possible for projects using e.g. Spring to
> >> manage the classes through the framework.
> >>
> >> Even better, google for 'evil singleton' and read the first few
> links...
> >>
> >> Best regards
> >> Henning
> >>
> >> I completely agree. Allowing plug-in frameworks to work would be the
> > ideal.
> > Giving me _any_ way to extend was my main concern.
> > I was just a bit wary of asking for too much :-)
> >
> > Cheers
> >
> > Joe
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Non-static Peers (was: Torque 4.0 plan)
Posted by Thomas Fischer <tf...@apache.org>.
Oops, I used the swear word "singleton" ... Fortunately, I probably
misused it. I did not mean to enforce singleton behaviour, i.e. to forbid
the existence of more than one instance. The static wrapper would be for
ease of usage, the Backend class for those which do not want to use static
method at all, and for the people in between, a setter to exchange the
backend of the static class. I have appended some sample code.
Would this be ok ? Any better suggestions ?
Thomas
The code would look as follows:
public class SomePeer
{
private static SomePeerBackend backend;
static
{
backend = new SomePeerBackend();
}
public static void setBackend(SomePeerBackend backend)
{
if (backend == null)
{
throw new NullPointerException();
}
this.backend = backend;
}
public static List doSelect(Criteria criteria)
{
return backend.doSelect(criteria);
}
....
}
public class SomePeerBackend
{
/** Public constructor */
public SomePeerBackend()
{
}
public List doSelect(Criteria criteria)
{
// do select, return results
...
}
...
}
On Fri, 1 Dec 2006, Joe Carter wrote:
> On 30/11/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
>>
>> "Joe Carter" <jo...@excite.com> writes:
>>
>> >Personally I'd just have the singleton (snip...)
>>
>> If you think about a singleton, please separate the singleton class
>> and the implementation class (don't have the static getInstance()
>> method and a possible private C'tor in the implementation). If you
>> separate these, it is possible for projects using e.g. Spring to
>> manage the classes through the framework.
>>
>> Even better, google for 'evil singleton' and read the first few links...
>>
>> Best regards
>> Henning
>>
>> I completely agree. Allowing plug-in frameworks to work would be the
> ideal.
> Giving me _any_ way to extend was my main concern.
> I was just a bit wary of asking for too much :-)
>
> Cheers
>
> Joe
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Joe Carter <jo...@excite.com>.
On 30/11/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
>
> "Joe Carter" <jo...@excite.com> writes:
>
> >Personally I'd just have the singleton (snip...)
>
> If you think about a singleton, please separate the singleton class
> and the implementation class (don't have the static getInstance()
> method and a possible private C'tor in the implementation). If you
> separate these, it is possible for projects using e.g. Spring to
> manage the classes through the framework.
>
> Even better, google for 'evil singleton' and read the first few links...
>
> Best regards
> Henning
>
> I completely agree. Allowing plug-in frameworks to work would be the
ideal.
Giving me _any_ way to extend was my main concern.
I was just a bit wary of asking for too much :-)
Cheers
Joe
Re: Torque 4.0 plan
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Joe Carter" <jo...@excite.com> writes:
>Personally I'd just have the singleton and ditch the static wrapper
>completely,
>however I recognise that having the wrapper would keep is closer to what
>exists already, so I'm not overly concerned. A method to get the singleton
>would make sense to match the set and would allow you to get an extended
>version
>of the back-end should that be available.
If you think about a singleton, please separate the singleton class
and the implementation class (don't have the static getInstance()
method and a possible private C'tor in the implementation). If you
separate these, it is possible for projects using e.g. Spring to
manage the classes through the framework.
Even better, google for 'evil singleton' and read the first few links...
Best regards
Henning
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Joe Carter" <jo...@excite.com> writes:
>Is there any chance we can make the Peer classes non-static?
>Currently it's hard/impossible to override/extend these without making
>generator changes. Perhaps have some form of central "registry" to
>hold these classes so that they can be globally looked up but
>also replaced/extended if desired.
At that point you will need sort of a context object like all the other O/R mappers have. :-)
>The other suggestions are all very good - especially removing village.
Definitely.
Best regards
Henning
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Joe Carter <jo...@excite.com>.
Personally I'd just have the singleton and ditch the static wrapper
completely,
however I recognise that having the wrapper would keep is closer to what
exists already, so I'm not overly concerned. A method to get the singleton
would make sense to match the set and would allow you to get an extended
version
of the back-end should that be available.
Thanks
Joe
On 30/11/06, Thomas Fischer <fi...@seitenbau.net> wrote:
>
>
> Ups, I knew I forgot something on the list. This was in my mind but did
> not
> make it into the email.
> As you wrote, the problem of static methods is that you cannot override
> its
> behaviour. The beauty of static methods is that invocation is very simple.
>
> The idea would be to have a static Wrapper class, which holds a singleton
> of the class with the implementation, and which passes all its static
> calls
> to the implementation class. There would be a setter of the singleton in
> the static class, so the backing class would be exchangeable.
> So one can use the static class if simple invocation is wanted, and the
> implementation class if maximum flexibility is needed.
>
> Thomas
>
> joe.carter@gmail.com schrieb am 30.11.2006 11:58:25:
>
> > Is there any chance we can make the Peer classes non-static?
> > Currently it's hard/impossible to override/extend these without making
> > generator changes. Perhaps have some form of central "registry" to
> > hold these classes so that they can be globally looked up but
> > also replaced/extended if desired.
> >
> > The other suggestions are all very good - especially removing village.
> >
> > Thanks
> >
> > Joe
> >
>
Re: Torque 4.0 plan
Posted by Thomas Fischer <fi...@seitenbau.net>.
Ups, I knew I forgot something on the list. This was in my mind but did not
make it into the email.
As you wrote, the problem of static methods is that you cannot override its
behaviour. The beauty of static methods is that invocation is very simple.
The idea would be to have a static Wrapper class, which holds a singleton
of the class with the implementation, and which passes all its static calls
to the implementation class. There would be a setter of the singleton in
the static class, so the backing class would be exchangeable.
So one can use the static class if simple invocation is wanted, and the
implementation class if maximum flexibility is needed.
Thomas
joe.carter@gmail.com schrieb am 30.11.2006 11:58:25:
> Is there any chance we can make the Peer classes non-static?
> Currently it's hard/impossible to override/extend these without making
> generator changes. Perhaps have some form of central "registry" to
> hold these classes so that they can be globally looked up but
> also replaced/extended if desired.
>
> The other suggestions are all very good - especially removing village.
>
> Thanks
>
> Joe
>
> On 29/11/06, Thomas Fischer <tf...@apache.org> wrote:
> >
> > Now that the first Torque RC is outit is time to think about what we'd
> > like
> > to do as next version. Personally, I'd like to propose the following:
> >
> > - Next version should be 4.0. There can be major changes in the
version,
> > but the 'look and feel' should change as little as possibl. The idea
> > would be that one can recompile one's Torque 3.2 or 3.3 project with
the
> > new Torque version and it should run with minor changes only.
> >
> > - Switch to Maven 2 as build system. Maven 2 has much better
multiproject
> > support than Maven 1, so building will be easier.
> >
> > - Simplify the repository structure: No svn externals any more. This
would
> > mean that all Torque components can only be released simultaneously,
but
> > as we have done so in the past anyway and compatibility problems would
> > arise if we would'nt do so, this should not be problematic.
> >
> > - Use Java 5 style generics and enumerations. One can use compiler
> > settings to produce pre-1.5-executable class files.
> >
> > - Kick out village. Village is bad. See the issue tracker for details.
> > This would mean: create the sql to insert / update objects ourselves;
do
> > the Torque type / SQL type mapping of variables orselves; create
objects
> > directly from jdbc result sets.
> >
> > - Use the Criteria object only to hold query data and another object to
> > hold update data. Criteria should not extend Hashtable any more nor
> > sahould it implement the map interface, cause query data is not a Map
in
> > any sense (e.g. the same column names can appear more than once in a
> > criteria)
> >
> > - Criterias should not be modified any more inside queries. Of one
needs
> > modification, one can copy the criteria.
> >
> > - Disentangle Query description and SQL creation code. In my eyes, it
> > would be ideal to port the MVC paradigm to the SQL creation: The
criteria
> > is the model (what do I want to query), the view would cretae the SQL
from
> > the Query, and the controller would be the Peer class which executes
the
> > query.
> >
> > - Use a column object to hold the column name in the runtime instead of
> > Strings. So one could remove all that distributed guesswork of "what is
> > the table name, do we have a schema name or not" etc. This would also
have
> > the advantge that a String is clearly a value and not a column name.
> >
> > - Make the generator more generic. I'd like to turn the generator into
a
> > generiy code generation tool, which can be used to create all sort of
> > code, not just database access code. I'm currently working on a
proposal.
> >
> > Any opinions ?
> >
> > Thomas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-dev-help@db.apache.org
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Joe Carter <jo...@excite.com>.
Is there any chance we can make the Peer classes non-static?
Currently it's hard/impossible to override/extend these without making
generator changes. Perhaps have some form of central "registry" to
hold these classes so that they can be globally looked up but
also replaced/extended if desired.
The other suggestions are all very good - especially removing village.
Thanks
Joe
On 29/11/06, Thomas Fischer <tf...@apache.org> wrote:
>
> Now that the first Torque RC is outit is time to think about what we'd
> like
> to do as next version. Personally, I'd like to propose the following:
>
> - Next version should be 4.0. There can be major changes in the version,
> but the 'look and feel' should change as little as possibl. The idea
> would be that one can recompile one's Torque 3.2 or 3.3 project with the
> new Torque version and it should run with minor changes only.
>
> - Switch to Maven 2 as build system. Maven 2 has much better multiproject
> support than Maven 1, so building will be easier.
>
> - Simplify the repository structure: No svn externals any more. This would
> mean that all Torque components can only be released simultaneously, but
> as we have done so in the past anyway and compatibility problems would
> arise if we would'nt do so, this should not be problematic.
>
> - Use Java 5 style generics and enumerations. One can use compiler
> settings to produce pre-1.5-executable class files.
>
> - Kick out village. Village is bad. See the issue tracker for details.
> This would mean: create the sql to insert / update objects ourselves; do
> the Torque type / SQL type mapping of variables orselves; create objects
> directly from jdbc result sets.
>
> - Use the Criteria object only to hold query data and another object to
> hold update data. Criteria should not extend Hashtable any more nor
> sahould it implement the map interface, cause query data is not a Map in
> any sense (e.g. the same column names can appear more than once in a
> criteria)
>
> - Criterias should not be modified any more inside queries. Of one needs
> modification, one can copy the criteria.
>
> - Disentangle Query description and SQL creation code. In my eyes, it
> would be ideal to port the MVC paradigm to the SQL creation: The criteria
> is the model (what do I want to query), the view would cretae the SQL from
> the Query, and the controller would be the Peer class which executes the
> query.
>
> - Use a column object to hold the column name in the runtime instead of
> Strings. So one could remove all that distributed guesswork of "what is
> the table name, do we have a schema name or not" etc. This would also have
> the advantge that a String is clearly a value and not a column name.
>
> - Make the generator more generic. I'd like to turn the generator into a
> generiy code generation tool, which can be used to create all sort of
> code, not just database access code. I'm currently working on a proposal.
>
> Any opinions ?
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Re: Torque 4.0 plan
Posted by Thomas Fischer <tf...@apache.org>.
On Fri, 1 Dec 2006, Jonathan Purvis wrote:
> Hi,
>
> Everything about the Torque 4.0 plans sounds good to me, especially
> getting rid of Village. However this one won't work:
>
>> - Use Java 5 style generics and enumerations. One can use compiler
>> settings to produce pre-1.5-executable class files.
>
> The autoboxing in 1.5 of int to Integer uses Integer.valueOf(int),
> which doesn't exist in 1.4. Also, javac won't let you:
>
> $ javac -target 1.4 Generic.java
> javac: target release 1.4 conflicts with default source release 1.5
>
> $ javac -target 1.4 -source 1.5 Generic.java
> javac: source release 1.5 requires target release 1.5
You are right, I was not aware of this. So what do we do ? I'd guess most
people will use java 1.5 by the time the new release is ready (I do not
think less than a year's development time is realistic), but I'm also sure
there are some users who cannot use Java 1.5.
Supporting 1.5 in the generator is the minimum option (we have that
already), but my original idea was to port the runtime and the other stuff
as well.
I'd guess if we do not do it in the step towards 4.0 we'll never make that
transition.
I'm undecided. Any opinions ?
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Jonathan Purvis <jo...@reeltwo.com>.
Hi,
Everything about the Torque 4.0 plans sounds good to me, especially
getting rid of Village. However this one won't work:
> - Use Java 5 style generics and enumerations. One can use compiler
> settings to produce pre-1.5-executable class files.
The autoboxing in 1.5 of int to Integer uses Integer.valueOf(int),
which doesn't exist in 1.4. Also, javac won't let you:
$ javac -target 1.4 Generic.java
javac: target release 1.4 conflicts with default source release 1.5
$ javac -target 1.4 -source 1.5 Generic.java
javac: source release 1.5 requires target release 1.5
Could it be an option on the generator instead?
Regards,
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Malcolm Kendall <mi...@blueyonder.co.uk>.
Hi Thomas,
> - Disentangle Query description and SQL creation code.
It would be very desirable at least for this Torque user, to have a
separate jar with no
dependencies for the Query description part.
We are using a lightweight client query mechanism, dubbed TorqueSmall,
that has refactored Criteria,SqlEnum and UniqueList (8K footprint).
Combined with transfer objects it allows Java and GWT clients
to make Torque style queries at a very low cost.
The transfer objects are hand crafted from the Base classes, :^(.
Having a reliable way to generate these, support Serializable and/or
IsSerializable
and strip out all dependencies, would also be an excellent improvement.
Not sure this really main stream Torque development, and would be
willing to
contribute development effort if appropriate.
Regards,
Malcolm Kendall
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Maven 2 support in 4.0 (Was: Torque 4.0 plan)
Posted by Henning Schmiedehausen <hp...@intermeta.de>.
Sure. As I said, I strongly recommend you to *think* before moving. Not
to not moving at all. My point is about maintainability, not about
technology. You don't have to list the advantages of maven 2 for
development / site building to me. :-)
Best regards
Henning
On Sat, 2006-12-02 at 04:40 -0800, Thomas Fischer wrote:
> I'd be -1 to switch to an ant build. It seems that people tend to forget
> the advantages that a maven build has, e.g. :
> - Maven has an easy dependency managing mechanism
> - Maven automatically executes the tests during building
> - Maven creates all these useful reports on the site
> And building the jars using ant and the site using maven is also not an
> option in my eyes. Plus, the maven 1 plugin needs a maven 1 build, and the
> maven 2 plugin needs a maven 2 build, so we'd need those anyway.
>
> The reason wy I believe it is better to do builds in maven 2 than in maven
> 1 are the following:
> - Maven 2 builds are much faster.
> - Maven 2 supports parent poms which do not exist locally
> - Maven 2 supports transitive dependencies
> - More people will stop using maven 1 in the future and use maven 2, so
> building from the sources will be easier for those (no deed to nsitall
> and configure maven 1)
>
> As for the migration, I'm volunteering to do it. And there is no sign of
> maven 3, so in my eyes the fear of another migration is unfounded.
>
> Thomas
>
>
> On Thu, 30 Nov 2006, Henning P. Schmiedehausen wrote:
>
> > "Greg Monroe" <Gr...@DukeCE.com> writes:
> >
> >>> - Switch to Maven 2 as build system. Maven 2 has much better
> >>> multiproject support than Maven 1, so building will be
> >>> easier.
> >
> >> My +0 for Maven 2 is based on the little bit I dug into it
> >> for the add-on stuff. It seemed to add a lot of complication
> >> and extra more effort to do thing outside the "Maven 2 norm"
> >> that was fairly easy in 1. IMHO, build systems should take a
> >> minimum of time away from your development time, not become
> >> a subproject of it's own.
> >
> > I'd *strongly* suggest thinking about the maven support. Maven changed
> > from 1 to 2 completely (different POMs, different program name,
> > different properties, different plugins, different docs) so people
> > moving from m1 to m2 had to throw all their configs (project.xml,
> > maven.xml, properties) away and rework them (most of the time from
> > scratch).
> >
> > And the projects relying on m1 suddently find out that people no
> > longer have the 'old' maven installed and complain about not being
> > able to build the project.
> >
> > There is no guarantee that moving from m2 to m3 will not be the same
> > thing.
> >
> > There *is* a simple solution: Provide basic project building with ant.
> >
> > ant stood the test of time quite nicely. Keep the maven (m1, m2) build
> > optional but build your release archives with ant.
> >
> > Best regards
> > Henning
> >
> > --
> > Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
> > 91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
> > Open Source Consulting, Development, Design | Velocity - Turbine guy
> >
> > "Save the cheerleader. Save the world."
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-dev-help@db.apache.org
> >
> >
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Maven 2 support in 4.0 (Was: Torque 4.0 plan)
Posted by Thomas Fischer <tf...@apache.org>.
I'd be -1 to switch to an ant build. It seems that people tend to forget
the advantages that a maven build has, e.g. :
- Maven has an easy dependency managing mechanism
- Maven automatically executes the tests during building
- Maven creates all these useful reports on the site
And building the jars using ant and the site using maven is also not an
option in my eyes. Plus, the maven 1 plugin needs a maven 1 build, and the
maven 2 plugin needs a maven 2 build, so we'd need those anyway.
The reason wy I believe it is better to do builds in maven 2 than in maven
1 are the following:
- Maven 2 builds are much faster.
- Maven 2 supports parent poms which do not exist locally
- Maven 2 supports transitive dependencies
- More people will stop using maven 1 in the future and use maven 2, so
building from the sources will be easier for those (no deed to nsitall
and configure maven 1)
As for the migration, I'm volunteering to do it. And there is no sign of
maven 3, so in my eyes the fear of another migration is unfounded.
Thomas
On Thu, 30 Nov 2006, Henning P. Schmiedehausen wrote:
> "Greg Monroe" <Gr...@DukeCE.com> writes:
>
>>> - Switch to Maven 2 as build system. Maven 2 has much better
>>> multiproject support than Maven 1, so building will be
>>> easier.
>
>> My +0 for Maven 2 is based on the little bit I dug into it
>> for the add-on stuff. It seemed to add a lot of complication
>> and extra more effort to do thing outside the "Maven 2 norm"
>> that was fairly easy in 1. IMHO, build systems should take a
>> minimum of time away from your development time, not become
>> a subproject of it's own.
>
> I'd *strongly* suggest thinking about the maven support. Maven changed
> from 1 to 2 completely (different POMs, different program name,
> different properties, different plugins, different docs) so people
> moving from m1 to m2 had to throw all their configs (project.xml,
> maven.xml, properties) away and rework them (most of the time from
> scratch).
>
> And the projects relying on m1 suddently find out that people no
> longer have the 'old' maven installed and complain about not being
> able to build the project.
>
> There is no guarantee that moving from m2 to m3 will not be the same
> thing.
>
> There *is* a simple solution: Provide basic project building with ant.
>
> ant stood the test of time quite nicely. Keep the maven (m1, m2) build
> optional but build your release archives with ant.
>
> Best regards
> Henning
>
> --
> Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
> 91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
> Open Source Consulting, Development, Design | Velocity - Turbine guy
>
> "Save the cheerleader. Save the world."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Future Torque build system (was: Re: Torque 4.0 plan)
Posted by Thomas Fischer <tf...@apache.org>.
On Tue, 5 Dec 2006, Henning P. Schmiedehausen wrote:
> Thomas Vandahl <th...@tewisoft.de> writes:
>
> Another piece of advice that I learned from a project that I'm
> involved with: Don't. Decide on *one* build, embrace it wholeheartedly
> and ditch everything else. Else you will get "project built with foo"
> jars, "project built with bar" jars and "project built with baz"
> jars. Each behaves a bit differently. Maintenance nightmare. Don't go
> there. :-)
>
At least we should have one "main build", and use the other build only to
build the respective plugin. I'm quite sure it is a nightmare to build a
maven2 plugin with maven 1; I'd expect it less nightmare to build a maven1
plugin using maven2, but I'm not sure if it is worse or better than
maintaining an extra build.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Thomas Vandahl <th...@tewisoft.de> writes:
Another piece of advice that I learned from a project that I'm
involved with: Don't. Decide on *one* build, embrace it wholeheartedly
and ditch everything else. Else you will get "project built with foo"
jars, "project built with bar" jars and "project built with baz"
jars. Each behaves a bit differently. Maintenance nightmare. Don't go
there. :-)
Best regards
Henning
>Henning P. Schmiedehausen wrote:
>> I'd *strongly* suggest thinking about the maven support. Maven changed
>> from 1 to 2 completely (different POMs, different program name,
>> different properties, different plugins, different docs) so people
>> moving from m1 to m2 had to throw all their configs (project.xml,
>> maven.xml, properties) away and rework them (most of the time from
>> scratch).
>I'd volunteer to keep the m1 build alive for this very reason. Thomas F.
>and I were talking about this already.
>Bye, Thomas.
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-dev-help@db.apache.org
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Thomas Vandahl <th...@tewisoft.de>.
Henning P. Schmiedehausen wrote:
> I'd *strongly* suggest thinking about the maven support. Maven changed
> from 1 to 2 completely (different POMs, different program name,
> different properties, different plugins, different docs) so people
> moving from m1 to m2 had to throw all their configs (project.xml,
> maven.xml, properties) away and rework them (most of the time from
> scratch).
I'd volunteer to keep the m1 build alive for this very reason. Thomas F.
and I were talking about this already.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Greg Monroe" <Gr...@DukeCE.com> writes:
>> - Switch to Maven 2 as build system. Maven 2 has much better
>> multiproject support than Maven 1, so building will be
>> easier.
>My +0 for Maven 2 is based on the little bit I dug into it
>for the add-on stuff. It seemed to add a lot of complication
>and extra more effort to do thing outside the "Maven 2 norm"
>that was fairly easy in 1. IMHO, build systems should take a
>minimum of time away from your development time, not become
>a subproject of it's own.
I'd *strongly* suggest thinking about the maven support. Maven changed
from 1 to 2 completely (different POMs, different program name,
different properties, different plugins, different docs) so people
moving from m1 to m2 had to throw all their configs (project.xml,
maven.xml, properties) away and rework them (most of the time from
scratch).
And the projects relying on m1 suddently find out that people no
longer have the 'old' maven installed and complain about not being
able to build the project.
There is no guarantee that moving from m2 to m3 will not be the same
thing.
There *is* a simple solution: Provide basic project building with ant.
ant stood the test of time quite nicely. Keep the maven (m1, m2) build
optional but build your release archives with ant.
Best regards
Henning
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Base Object / Record Object Design ( Was: Torque 4.0 plan )
Posted by Greg Monroe <Gr...@DukeCE.com>.
Comments inline...
> -----Original Message-----
> Thomas Fischer said:
>
> On Thu, 30 Nov 2006, Greg Monroe wrote:
> > ...
>
> > To support this and also assist in the Village exorcism,
> > I'd propose making the BaseObject an actual storage
> > implimentation, like Village Record or ResultsSet. Internally
> > the data would be stored as objects in OrderedMap with the
> > getBy/setBy methods being the BaseObject access points.
> >
> > This would allow executeQuery to return a list of BaseObject
> > records.
> >
> > Additionally, the generated record objects could make use
> > of this new base class to support things like isNull() on
> > primitives. We could also use this to track modified and
> > unmodified column values, which would be very useful (e.g.
> > updating tables without primary keys).
>
> I'm note sure whether this is the best possible approach. I'd
> rather work with a jdbc result set and generate a method that
> directly populates an object from the jdbc result set. This
> has the advantage that you can rely on type conversion of the
> jdbcDriver (getAsInt etc) and do not have the trouble to store
> which type which object is. It is also faster and less
> memory-consuming.
I can see that. But if we hope to support non-record queries,
we'll still need to have a Generic Record object. In my mind,
I was combining the solution to the two.
FWIW, I was thinking that the generated record object would be
the one to track the object type. E.g., rather than generate
field definition in the Base object, the getColumn() methods
would be generated to get the correct object from the list
(by name or position) and return it cast as the correct object.
One advantage I can see with a more solid BaseObject is that
it could make doing global changes across all generated code
easier. E.g., create a subclass and generate with your
local BaseObjects to extend this rather than the Torque
default.
>
> This can be achieved in two different ways. Thomas V's
> favorite is just calling an abstract method in BasePeer
> which gets overridden in each concrete peer and which is
> called for each row in the resultSet. something like
>
> ResultSet resultSet = doSelectSomething();
> while(resultSet.next())
> {
> resultList.add(createObject(resultSet))
> }
>
> and the createObject() method would be generated for each
> peer.
>
> My favourite is to use an ObjectCreator class, which would be
> called for each row in a resultSet and create an object out
> of it. The concrete Peer itself could be the Object creator.
>
> The first has the advantage of being the simplest possible
> approach, the second is more flexible (the method which does
> the selects and calls the ObjectCreator could be used for
> custom object creators, which use the values in the data row
> in any way they like)., and so provide a replacement for the
> doSelectVollageRecords, which is uften used for custom selects
> now.
>
Hmm, not sure which is better. One idea to throw into the mix
is to do the following:
Make generation of the getBy/setBy methods non-optional. The
set methods currently do Object type checking and can easily
be modified to save them into the Object based field storage
(where ever that ends up) Then all you need to populate an
object is to do something like:
----------------------
void populate(BaseObject rec, ResultSet rs )
{
ColumnMap columns[] = rec.getTableMap().getColumns();
// Note: could simplify this by generating a column name
// array in peer or maybe using a metadata call to get the
// column names.
for ( int i = 0; I < columns.length; i++ )
{
String columnName = columns[i].getName();
Object value = null;
try
{
value = resultSet.getObject(columns[i].getName());
}
catch ( SQLException e )
{
throw TorqueException(
"Result set did not include a value for col X",e);
}
// Possibly need some value "massaging method" here to handle JDBC
// variances, e.g. Oracle driver and Timestamps?
rec.setByName(columns[i].getJavaName(), value);
}
}
------------------------
I think we need to make sure that whatever solution we
use can be locally modified to support JDBC variances.
Maybe having a "mapping" JDBC to Torque types mapping
object in the DB adaptor would be a good place.
Hopefully, it will just be a common do nothing method.
We also need to consider cases where an DB schema column
type does not map directly into Torque. There are cases
in the Generator like SQL type DECIMAL(19,0) being mapped
into Torque BIGINT. There are also cases where people have
mapped existing application DB schema's into Torque and
have "gotten away" with close maps (E.g., the problem with
NUMERIC being mapped into DOUBLE).
If you consider these, I'm not sure we can totally depend
on JDBC to do the right thing. We probably will have to
design in some type of conversion mechanism.
Greg
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Non-record type queries/ statements ( Was: Torque 4.0 plan)
Posted by Thomas Vandahl <tv...@apache.org>.
Greg Monroe wrote:
> BaseObject rec = (BaseObject) rs.next();
> String topicTitle = (String) rec.getByName("t_title");
This is as "easy" as plain JDBC. This is not what Torque is about. It is
easy enough to work with the populateObject methods. I do this all the
time. The doSelectJoin methods have simplified a lot in my code. So what
if I select columns I don't really need. It is easier to write and
easier to read.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Non-record type queries/ statements ( Was: Torque 4.0 plan)
Posted by Greg Monroe <Gr...@DukeCE.com>.
> -----Original Message-----
> Thomas Fischer said:
>
> On Thu, 30 Nov 2006, Greg Monroe wrote:
> >
> > Better support for non-record type queries. I.e., the
> > stuff people do with executeQuery / Village Records. Queries
> > of this type that come to mind are:
> >
> > - Optimized Join queries that return data from multiple
> > tables (for creating master lists).
>
> you mean something like the DoSelectJoinXXX() queries ?
> >
I was probably getting to specific here for a general concept.
By better non-record query support, I meant better general
support for that the whole set of queries or statements
that are not single table related. The example I had in
mind here was to make sure you could represent and run a query
like:
Select topics.subject as t_title, topics.date as t_date,
users.name as t_poster, posts.subject as last_post, ...
from topics, users, posts
where (join stuff, etc.) ..
and getting this dynamic record info could be as easy as:
BaseObject rec = (BaseObject) rs.next();
String topicTitle = (String) rec.getByName("t_title");
Plus there's a whole categories of INSERT, UPDATE, and DELETE
statements that use subselects or WHERE clauses that have to
be created with String concats to work now. Especially with
tables that don't have primary keys.
Now that I've expanded this, I guess the general concept here
is to expand or ensure that the Criteria design can represent
such queries and that there is a clear process for running
them. Instead of the current "Go figure out the Village layer"
answer that is common today.
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
RE: Torque 4.0 plan
Posted by Thomas Fischer <tf...@apache.org>.
On Thu, 30 Nov 2006, Greg Monroe wrote:
> ...
>> - Switch to Maven 2 as build system. Maven 2 has much better
>> multiproject support than Maven 1, so building will be
>> easier.
>
> My +0 for Maven 2 is based on the little bit I dug into it
> for the add-on stuff. It seemed to add a lot of complication
> and extra more effort to do thing outside the "Maven 2 norm"
> that was fairly easy in 1. IMHO, build systems should take a
> minimum of time away from your development time, not become
> a subproject of it's own.
>
> But to be fair, it could be I just didn't take the time to
> learn it well enough. But if someone else is doing the work ;)
> who am I to complain...lol
I'd volunteer to set it up. Maven 2 has a better multiproject support than
maven 1, so some stuff will also be easier. Also, it is much faster on
building.
if there is trouble, we can still decide what we do when we have a
prototype.
>
>> - Make the generator more generic. I'd like to turn the
>> generator into a generic code generation tool
>
> I'm +0 on the idea of the generic generator. I can see the
> worth in this, but I'm not sure it's a core Torque thing.
> It seems like this should be like Torque and Turbine, some
> of the ground work layed here but with a plan to split it
> off into a separate project.
The generator is already quite a separate project which can be
used on its own. The only torque specific stuff now is the parsing of the
schema.xml and putting it into the database model. Ok, throw that out, and
nothing is left of the generator as it is now, but here my idea was a
replacement and not a slow migration. The torque specific stuff (no
java, but meta-information) can go into the templates.
> Plus, is this competing with
> Velocity/Texen?
Well, my idea would be to support velcocity, of course, but also other
templating languages like xslt, and also plain java. So it would be more
powerful than texen, but yes, you could call it "competing" if you like.
>...
> Here's some idea's I'll throw in the ring:
>
> Better support for non-record type queries. I.e., the
> stuff people do with executeQuery / Village Records. Queries
> of this type that come to mind are:
>
> - Optimized Join queries that return data from multiple
> tables (for creating master lists).
you mean something like the DoSelectJoinXXX() queries ?
>
> - Queries with functions.
+1
> To support this and also assist in the Village exorcism,
> I'd propose making the BaseObject an actual storage
> implimentation, like Village Record or ResultsSet. Internally
> the data would be stored as objects in OrderedMap with the
> getBy/setBy methods being the BaseObject access points.
>
> This would allow executeQuery to return a list of BaseObject
> records.
>
> Additionally, the generated record objects could make use
> of this new base class to support things like isNull() on
> primitives. We could also use this to track modified and
> unmodified column values, which would be very useful (e.g.
> updating tables without primary keys).
I'm note sure whether this is the best possible approach. I'd rather work
with a jdbc result set and generate a method that directly populates an
object from the jdbc result set. This has the advantage that you can rely
on type conversion of the jdbcDriver (getAsInt etc) and do not have the
trouble to store which type which object is. It is also faster and less
memory-consuming.
This can be achieved in two different ways. Thomas V's favorite is just
calling an abstract method in BasePeer which gets overridden in each
concrete peer and which is called for each row in the resultSet. something
like
ResultSet resultSet = doSelectSomething();
while(resultSet.next())
{
resultList.add(createObject(resultSet))
}
and the createObject() method would be generated for each peer.
My favourite is to use an ObjectCreator class, which would be called for
each row in a resultSet and create an object out of it. The concrete Peer
itself could be the Object creator.
The first has the advantage of being the simplest possible approach, the
second is more flexible (the method which does the selects and calls the
ObjectCreator could be used for custom object creators, which use the
values in the data row in any way they like)., and so provide a
replacement for the doSelectVollageRecords, which is uften used for
custom selects now.
> Take a serious look at DDLUtils integration, and maybe do
> a little encouraging to get that project to do a release/
> Maven repo set up.
+1
> Some stuff that may be V4.5 features but might be nice to
> start planning for:
>
> Add full support for views, since most of the common DBs
> support them. E.g., a way to define them in the DTD,
> support for creation, etc.
+1 (repeating myself)
> Look at being able to generate object level "views". E.g.,
> I'm always creating "wrapper" objects that are based on
> subsets of data from two or more related tables, with access,
> load, and store methods. I'm thinking this would be a way
> to define business objects via XML and have them generated.
+1
> Support for "lazy" record object population. Sometimes it's
> better to retrieve a set of partially filled objects (e.g.
> doing a master list), and only totally fill the object when
> needed. Adding an isLoaded option to the isNull, isModified,
> column level tracking would make this fairly easy.
Not sure whether this would not get too complicated. Also, it would be
difficult to achieve transaction support (the transaction would have to
be kept open till everything is accessed).
> A GUID based idBroker method to autogenerate keys without
> needing access to a table.
I'm also not sure whether this is worth the effort. I'm sure the idbroker
was gread when native id generation was difficult, but now I hold native
id generation as the way to go. Why would one want to use the IdBroker in
a new project nowadays ?
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Primitives or not
Posted by Thomas Fischer <tf...@apache.org>.
On Fri, 1 Dec 2006, Thomas Vandahl wrote:
> Greg Monroe wrote:
>> On the record side of things, I can't see that it's
>> a big problem to keep supporting the primitive XML
>> option. Let the application designer decided whether
>> to use primitive or objects via this. It's only a
>> VERY small set of template code that's required to
>> create primitive getter/setters. Everything internally
>> can be object or not.
>
> I don't think so. As Torque works now, you can define a column to be a
> primitive (int) and Nullable at the same time. In Torque you have no way
> to decide whether this column is null or 0 (which is what Torque sets).
> Objects can really be null and so you can distinguish between the two
> cases. So this is the much cleaner approach.
>
> The other way round, you won't be able to store null in such a table,
> simply because the primitive value cannot be null.
>
There is a similar problem for primary keys. E.g. if a promitive integer
is used as a primary key, the value "0" means that the object has no
primary key. It is not possible to save an object with the primary key
explicitly set to 0.
If we do not use Jdk 1.5, two and a half possible solutions come to my
mind:
1) Do not use primitives internally, but allow primitive getters and
setters. This will allow the user to read in a database row where null is
set for a primitive filed, but querying this field will rase an exception
(this is the correct behaviour in my eyes). This also will simplify
templates a little bit: there are few places where primitive columns are
treated differently, and the places where a key oubject is created from a
column will also be shorter.
Changing the internal representation will not be visible to end users: The
field itself is private and only accessible via its getters and setters.
The disadvantage of this approach is its slight performance impact of
boxing and unboxing every time.
2a) Disallow nullable for primitives and foreign keys. Disallow primitives
at all for primary keys.
2b) Disallow nullable for primary keys. Intoduce an extra boolean whether
a primary key is already set or not.
Personally, I'd prefer 1), because it is the simplest possible solution.
2a) is incompatible with the current implementation (no primitive primary
keys), and 2b is too complicated in my eyes.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Primitives or not (Was: Torque 4.0 plan)
Posted by Thomas Vandahl <tv...@apache.org>.
Greg Monroe wrote:
> On the record side of things, I can't see that it's
> a big problem to keep supporting the primitive XML
> option. Let the application designer decided whether
> to use primitive or objects via this. It's only a
> VERY small set of template code that's required to
> create primitive getter/setters. Everything internally
> can be object or not.
I don't think so. As Torque works now, you can define a column to be a
primitive (int) and Nullable at the same time. In Torque you have no way
to decide whether this column is null or 0 (which is what Torque sets).
Objects can really be null and so you can distinguish between the two
cases. So this is the much cleaner approach.
The other way round, you won't be able to store null in such a table,
simply because the primitive value cannot be null.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Primitives or not (Was: Torque 4.0 plan)
Posted by Greg Monroe <Gr...@DukeCE.com>.
I guess the real question is:
What do we mean by "Throw away primitives"?
There are three main area I think we are talking about:
The record objects, the criteria objects, and overall
runablity / compilability.
On the record side of things, I can't see that it's
a big problem to keep supporting the primitive XML
option. Let the application designer decided whether
to use primitive or objects via this. It's only a
VERY small set of template code that's required to
create primitive getter/setters. Everything internally
can be object or not.
The criteria object is a slightly different problem.
On one hand, I can see that going to object only would
simplify the multitude of add methods. But it would
cause a lot of code to be re-written.
It may be time to dust off my VERY rough pass at
creating a criteria API that Thomas T and I kicked
around a LONG time ago. This might be useful to have
a "deprecated but works like the original" criteria and
a "new improved object only" criteria. Then let the
developer choose (with an emphasis on the DEPRECATED
fact...)
As to the compilablity / runablity issues...
Personally, I'd like Torque generated code to be
compilable/runnable under 1.4. There are still a lot
of folks "stuck" at this level for various reasons.
With Java going GPL, I suspect this number will be
dropping.. but probably not too fast.
But the hard limit is that it definitely needs to be
RUNNABLE under 1.4. I.e., you need 1.5 to create the
OM layer but not run it. But as people have pointed
out, there is a whole bunch of 'gotchas' to look out
for with this scenario.
> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> Sent: Thursday, November 30, 2006 6:21 PM
> To: torque-dev@db.apache.org
> Subject: Re: Torque 4.0 plan
>
> Thomas Vandahl <th...@tewisoft.de> writes:
>
> >Greg Monroe wrote:
>
> >> Additionally, the generated record objects could make use
> >> of this new base class to support things like isNull() on
> >> primitives. We could also use this to track modified and
> >> unmodified column values, which would be very useful (e.g.
> >> updating tables without primary keys).
>
> >I'd throw primitives away completely. There is no advantage
> in keeping
> >them. Especially with JDK 1.5.
>
> You lose all the J2EE 1.4 people. J2EE will be (in the real world) on
> JDK 1.4 for a long time.
>
> There are tools like Retroweaver but throwing primitive support out is
> IMHO too early. Hibernate did and people still complain about it.
>
> Best regards
> Henning
>
>
>
> --
> Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
> 91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
> Open Source Consulting, Development, Design | Velocity - Turbine guy
>
> "Save the cheerleader. Save the world."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Thomas Vandahl <th...@tewisoft.de> writes:
>Greg Monroe wrote:
>> Additionally, the generated record objects could make use
>> of this new base class to support things like isNull() on
>> primitives. We could also use this to track modified and
>> unmodified column values, which would be very useful (e.g.
>> updating tables without primary keys).
>I'd throw primitives away completely. There is no advantage in keeping
>them. Especially with JDK 1.5.
You lose all the J2EE 1.4 people. J2EE will be (in the real world) on
JDK 1.4 for a long time.
There are tools like Retroweaver but throwing primitive support out is
IMHO too early. Hibernate did and people still complain about it.
Best regards
Henning
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
RE: Torque 4.0 plan
Posted by Thomas Fischer <tf...@apache.org>.
On Thu, 30 Nov 2006, Greg Monroe wrote:
>> Thomas Vandahl said:
>>
>> Greg Monroe wrote:
>>
>>> Additionally, the generated record objects could make use
>>> of this new base class to support things like isNull() on
>>> primitives. We could also use this to track modified and
>>> unmodified column values, which would be very useful (e.g.
>>> updating tables without primary keys).
>>
>> I'd throw primitives away completely. There is no advantage
>> in keeping them. Especially with JDK 1.5.
>
> I think there's still benefit in having record objects with
> primitive get/set field access methods. They are like the
> static Peer methods, not the best way to do things, but they
> make coding easier.
>
> But the underlying storage could be Object based with conversion
> occuring in the generated field methods. Even with these, the
> underlying objects could still be access via the getBy/setBy
> methods.
>
> Of course, there would be a slight performance hit since the
> conversion takes place each time the method is called rather
> than at population time.
>
If we only use objects internally, this would make coding and templating
easier. I do not think the small performance overhead of object/primitive
conversion matters much nowadays.
If we use java 1.5, I'm not sure whether primitive accessors and setters
make sense at all (better create the cost of conversion on the user's
side, so he can take control over it)
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
RE: Torque 4.0 plan
Posted by Greg Monroe <Gr...@DukeCE.com>.
> Thomas Vandahl said:
>
> Greg Monroe wrote:
>
> > Additionally, the generated record objects could make use
> > of this new base class to support things like isNull() on
> > primitives. We could also use this to track modified and
> > unmodified column values, which would be very useful (e.g.
> > updating tables without primary keys).
>
> I'd throw primitives away completely. There is no advantage
> in keeping them. Especially with JDK 1.5.
I think there's still benefit in having record objects with
primitive get/set field access methods. They are like the
static Peer methods, not the best way to do things, but they
make coding easier.
But the underlying storage could be Object based with conversion
occuring in the generated field methods. Even with these, the
underlying objects could still be access via the getBy/setBy
methods.
Of course, there would be a slight performance hit since the
conversion takes place each time the method is called rather
than at population time.
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 4.0 plan
Posted by Thomas Vandahl <th...@tewisoft.de>.
Greg Monroe wrote:
> Additionally, the generated record objects could make use
> of this new base class to support things like isNull() on
> primitives. We could also use this to track modified and
> unmodified column values, which would be very useful (e.g.
> updating tables without primary keys).
I'd throw primitives away completely. There is no advantage in keeping
them. Especially with JDK 1.5.
> Add full support for views, since most of the common DBs
> support them. E.g., a way to define them in the DTD,
> support for creation, etc.
+1 on this. This shouldn't be too difficult to handle.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
RE: Torque 4.0 plan
Posted by Greg Monroe <Gr...@DukeCE.com>.
> Thomas Fischer said:
>
> Now that the first Torque RC is outit is time to think about
> what we'd like to do as next version. Personally, I'd like
> to propose the following:
>
Can't complain about that list. Only +0 items I'd list
would be on the Maven 2 conversion and the generic generator.
> - Switch to Maven 2 as build system. Maven 2 has much better
> multiproject support than Maven 1, so building will be
> easier.
My +0 for Maven 2 is based on the little bit I dug into it
for the add-on stuff. It seemed to add a lot of complication
and extra more effort to do thing outside the "Maven 2 norm"
that was fairly easy in 1. IMHO, build systems should take a
minimum of time away from your development time, not become
a subproject of it's own.
But to be fair, it could be I just didn't take the time to
learn it well enough. But if someone else is doing the work ;)
who am I to complain...lol
> - Make the generator more generic. I'd like to turn the
> generator into a generic code generation tool
I'm +0 on the idea of the generic generator. I can see the
worth in this, but I'm not sure it's a core Torque thing.
It seems like this should be like Torque and Turbine, some
of the ground work layed here but with a plan to split it
off into a separate project. Plus, is this competing with
Velocity/Texen? None of this is a show stopper, just thoughts
for fine tuning the proposal.
Here's some idea's I'll throw in the ring:
Better support for non-record type queries. I.e., the
stuff people do with executeQuery / Village Records. Queries
of this type that come to mind are:
- Optimized Join queries that return data from multiple
tables (for creating master lists).
- Queries with functions.
To support this and also assist in the Village exorcism,
I'd propose making the BaseObject an actual storage
implimentation, like Village Record or ResultsSet. Internally
the data would be stored as objects in OrderedMap with the
getBy/setBy methods being the BaseObject access points.
This would allow executeQuery to return a list of BaseObject
records.
Additionally, the generated record objects could make use
of this new base class to support things like isNull() on
primitives. We could also use this to track modified and
unmodified column values, which would be very useful (e.g.
updating tables without primary keys).
Take a serious look at DDLUtils integration, and maybe do
a little encouraging to get that project to do a release/
Maven repo set up.
Some stuff that may be V4.5 features but might be nice to
start planning for:
Add full support for views, since most of the common DBs
support them. E.g., a way to define them in the DTD,
support for creation, etc.
Look at being able to generate object level "views". E.g.,
I'm always creating "wrapper" objects that are based on
subsets of data from two or more related tables, with access,
load, and store methods. I'm thinking this would be a way
to define business objects via XML and have them generated.
Support for "lazy" record object population. Sometimes it's
better to retrieve a set of partially filled objects (e.g.
doing a master list), and only totally fill the object when
needed. Adding an isLoaded option to the isNull, isModified,
column level tracking would make this fairly easy.
A GUID based idBroker method to autogenerate keys without
needing access to a table.
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org