| Newsgroups |
gmane.comp.java.orm.simpleorm |
| Message-ID |
<CA+_PZMfjVy0sLG_2HKqH3=LgZdJcatr_6SzPj90GxmW=Wa=acw@mail.gmail.com> |
--001a113d42dc03ece905084650c6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
P.S. Yes, checked exceptions are a particularly awful idea because they
encourage people to gobble exceptions, as do the standard Java libraries.
I did not write that code.
It is interesting that when Java was hot circa 2000 many people believed
that checked exceptions made sense. It is only relatively recently that
people started to think differently. There needs to be a compiler option
to ignore them, but that will never happen. SimpleOrm never had checked
exceptions.
On Thu, Nov 20, 2014 at 6:38 PM, anthony berglas <[email protected]>
wrote:
> Had a quick look at JOOQ. Hard to tell at a glance what it is doing but
> looks interesting. I did see
> record.getValue(AUTHOR.FIRST_NAME); // similar to simpleORM
> rather than the normal record.name POJO stuff. I hope that the constant
> is a type and not just a string.
>
> The way that SimpleOrm uses Java as the source of truth and then generate=
s
> DB Schemas allows extra meta data to be associated with tables. It also
> allows schemas to be generated for different databases from a common sour=
ce.
>
> JOOQ seems to have quite a sophisticated query engine. But with
> enhancements by Frank SimpleOrm covers all the common cases quite well.
> There will always be more complex queries in which one needs to descend
> into the underlying SQL, so there is diminishing returns in making the
> query language too complex.
>
> Anthony
>
>
> On Fri, Nov 7, 2014 at 7:23 PM, Joachim Durchholz [email protected]
> [SimpleORM] <[email protected]> wrote:
>
>>
>>
>> Am 07.11.2014 um 04:15 schrieb anthony berglas [email protected]
>> [SimpleORM]:
>> > Ha! There lies the rub. It is a Hibernate world, in all its glory. And
>> > about 5% of it is actually useful.
>>
>> If you have limited amounts of data and stick to short transactions
>> (which is a good idea anyway), Hibernate actually works quite well.
>>
>> The real problem with Hibernate is its promise of "map records to POJOs
>> and work with POJOs normal", on which it does not deliver. (No ORM can
>> deliver on such a promise, no normal POJO may go "out of sync" due to
>> concurrent updates.)
>>
>> > If you find something let me know. All I have seen is rubbish. Lots of
>> > mapping to objects using reflection, nothing useful. What is wanted is
>> > something simple.
>>
>> Jooq seems interesting. Instead of hiding SQL, it offers a (largely)
>> typesafe SQL construction and result extraction API.
>> I have not used it myself, and it's started to go into feature bloat
>> mode, so there may be caveats, but at least it's a fresh and useful(!)
>> approach.
>>
>> > A project that I am working on now has some very simple code (not
>> written
>> > by me) that just wraps SQL, sample below. You could knock something up
>> > yourself like that pretty quick. If you make it into a clean module
>> please
>> > post it to this list. But that still leaves many issues.
>>
>> First thing I'd do is change the interface to not use checked
>> exceptions. Checked exceptions are on of these things that sound nice in
>> theory but turn into pure evil in practice.
>>
>> Use unchecked exceptions.
>> If you find your applications need to do something specific with
>> specific JDBC failure modes, extend the API to allow for that.
>>
>> Oh, and if you want to do something really useful, structure the API
>> around some kind of repeatable ApplicationTransaction or whatever you
>> name it.
>> The issue is that at least Oracle has several failure modes where you
>> can simply retry the transaction from scratch and everything will be
>> fine. The issue here isn't so much technical but that you'll have to
>> explain to the user user that needs to re-enter his exactly same inputs
>> "and now it works". Oh, and if a nightly batch run fails due to a
>> transient error and your code does not retry, that's going to make
>> everybody unhappy who wants current-day data, and your boss, too.
>>=20=20
>>
>
>
>
> --
>
> Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
> Just because it is possible to push twigs along the ground with ones nose
> does not necessarily mean that that is the best way to collect firewood.
>
--=20
Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that that is the best way to collect firewood.
--001a113d42dc03ece905084650c6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<head>
<style type=3D"text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title=20
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;=20
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html>
<head>
<style type=3D"text/css">
<!--
#ygrp-mkp {
border: 1px solid #d8d8d8;
font-family: Arial;
margin: 10px 0;
padding: 0 10px;
}
#ygrp-mkp hr {
border: 1px solid #d8d8d8;
}
#ygrp-mkp #hd {
color: #628c2a;
font-size: 85%;
font-weight: 700;
line-height: 122%;
margin: 10px 0;
}
#ygrp-mkp #ads {
margin-bottom: 10px;
}
#ygrp-mkp .ad {
padding: 0 0;
}
#ygrp-mkp .ad p {
margin: 0;
}
#ygrp-mkp .ad a {
color: #0000ff;
text-decoration: none;
}
-->
</style>
</head>
<body>
<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif">P.S.=C2=A0 Yes, checked exceptions are a particularly awful ide=
a because they encourage people to gobble exceptions, as do the standard Ja=
va libraries.=C2=A0 I did not write that code. =C2=A0</div><div class=3D"gm=
ail_default" style=3D"font-family:verdana,sans-serif"><br></div><div class=
=3D"gmail_default" style=3D"font-family:verdana,sans-serif">It is interesti=
ng that when Java was hot circa 2000 many people believed that checked exce=
ptions made sense.=C2=A0 It is only relatively recently that people started=
to think differently.=C2=A0 There needs to be a compiler option to ignore =
them, but that will never happen.=C2=A0 SimpleOrm never had checked excepti=
ons.</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">O=
n Thu, Nov 20, 2014 at 6:38 PM, anthony berglas <span dir=3D"ltr"><<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>=
></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div =
class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">Had a quic=
k look at JOOQ.=C2=A0 Hard to tell at a glance what it is doing but looks i=
nteresting.=C2=A0 I did see</div><div class=3D"gmail_default" style=3D"font=
-family:verdana,sans-serif">=C2=A0=C2=A0<span style=3D"font-family:arial">r=
ecord</span><span style=3D"font-family:arial">.</span><span style=3D"font-f=
amily:arial">getValue</span><span style=3D"font-family:arial">(</span><span=
style=3D"font-family:arial">AUTHOR</span><span style=3D"font-family:arial"=
>.</span><span style=3D"font-family:arial">FIRST_NAME</span><span style=3D"=
font-family:arial">); =C2=A0// similar to simpleORM</span></div><div class=
=3D"gmail_default" style=3D"font-family:verdana,sans-serif"><span style=3D"=
font-family:arial">rather than the normal <a href=3D"http://record.name" ta=
rget=3D"_blank">record.name</a> POJO stuff.=C2=A0 I hope that the constant =
is a type and not just a string.</span></div><div class=3D"gmail_default" s=
tyle=3D"font-family:verdana,sans-serif"><span style=3D"font-family:arial"><=
br></span></div><div class=3D"gmail_default">The way that SimpleOrm uses Ja=
va as the source of truth and then generates DB Schemas allows extra meta d=
ata to be associated with tables.=C2=A0 It also allows schemas to be genera=
ted for different databases from a common source.</div><div class=3D"gmail_=
default"><br></div><div class=3D"gmail_default">JOOQ seems to have quite a =
sophisticated query engine.=C2=A0 But with enhancements by Frank SimpleOrm =
covers all the common cases quite well.=C2=A0 There will always be more com=
plex queries in which one needs to descend into the underlying SQL, so ther=
e is diminishing returns in making the query language too complex.</div><sp=
an class=3D"HOEnZb"><font color=3D"#888888"><div class=3D"gmail_default"><b=
r></div><div class=3D"gmail_default">Anthony</div><div class=3D"gmail_defau=
lt"><br></div><pre><span></span></pre></font></span></div><div class=3D"gma=
il_extra"><div><div class=3D"h5"><br><div class=3D"gmail_quote">On Fri, Nov=
7, 2014 at 7:23 PM, Joachim Durchholz <a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a> [SimpleORM] <span dir=3D"ltr"><<a=
href=3D"mailto:[email protected]" target=3D"_blank">SimpleORM@yaho=
ogroups.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
=20
<div style=3D"background-color:#fff">
<span>=C2=A0</span>
<div>
<div>
<div>
=20=20=20=20=20=20
=20=20=20=20=20=20
<p>Am 07.11.2014 um 04:15 schrieb anthony berglas <a href=3D"mailto:a=
[email protected]" target=3D"_blank">[email protected]</a> <br>
[SimpleORM]:<span><br>
> Ha! There lies the rub. It is a Hibernate world, in all its glory. =
And<br>
> about 5% of it is actually useful.<br>
<br></span>
If you have limited amounts of data and stick to short transactions <br>
(which is a good idea anyway), Hibernate actually works quite well.<br>
<br>
The real problem with Hibernate is its promise of "map records to POJO=
s <br>
and work with POJOs normal", on which it does not deliver. (No ORM can=
<br>
deliver on such a promise, no normal POJO may go "out of sync" du=
e to <br>
concurrent updates.)<span><br>
<br>
> If you find something let me know. All I have seen is rubbish. Lots =
of<br>
> mapping to objects using reflection, nothing useful. What is wanted i=
s<br>
> something simple.<br>
<br></span>
Jooq seems interesting. Instead of hiding SQL, it offers a (largely) <br>
typesafe SQL construction and result extraction API.<br>
I have not used it myself, and it's started to go into feature bloat <b=
r>
mode, so there may be caveats, but at least it's a fresh and useful(!) =
<br>
approach.<span><br>
<br>
> A project that I am working on now has some very simple code (not writ=
ten<br>
> by me) that just wraps SQL, sample below. You could knock something u=
p<br>
> yourself like that pretty quick. If you make it into a clean module p=
lease<br>
> post it to this list. But that still leaves many issues.<br>
<br></span>
First thing I'd do is change the interface to not use checked <br>
exceptions. Checked exceptions are on of these things that sound nice in <b=
r>
theory but turn into pure evil in practice.<br>
<br>
Use unchecked exceptions.<br>
If you find your applications need to do something specific with <br>
specific JDBC failure modes, extend the API to allow for that.<br>
<br>
Oh, and if you want to do something really useful, structure the API <br>
around some kind of repeatable ApplicationTransaction or whatever you <br>
name it.<br>
The issue is that at least Oracle has several failure modes where you <br>
can simply retry the transaction from scratch and everything will be <br>
fine. The issue here isn't so much technical but that you'll have t=
o <br>
explain to the user user that needs to re-enter his exactly same inputs <br=
>
"and now it works". Oh, and if a nightly batch run fails due to a=
<br>
transient error and your code does not retry, that's going to make <br>
everybody unhappy who wants current-day data, and your boss, too.<br>
</p>
</div>
=20=20=20=20=20
=20=20=20=20
<div style=3D"color:#fff;min-height:0"></div>
</div>
=20=20
</blockquote></div><br><br clear=3D"all"><div><br></div></div></div><span c=
lass=3D"">-- <br><div><p>
</p><p>Dr Anthony Berglas, <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Mobile=
: +61 4 4838 8874<br>
Just because it is possible to push twigs along the ground with ones nose<b=
r>
does not necessarily mean that that is the best way to collect firewood.</p=
></div>
</span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><p>
</p><p>Dr Anthony Berglas, <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Mobile=
: +61 4 4838 8874<br>
Just because it is possible to push twigs along the ground with ones nose<b=
r>
does not necessarily mean that that is the best way to collect firewood.</p=
></div>
</div>
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>
=20=20=20=20=20=20
=20=20
=20=20=20=20
<div id=3D"fromDMARC" style=3D"clear:both; margin-top: 10px;">
<hr style=3D"height:2px ; border-width:0; color:#E3E3E3; backgroun=
d-color:#E3E3E3;">
Posted by: anthony berglas <[email protected]> <hr=
style=3D"height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E=
3E3;">
</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D7360226/grpspI=
d=3D1705006905/msgId=3D2112/stime=3D1416472970" width=3D"1" height=3D"1"> <=
br>
<!-- |**|end egp html banner|**| -->
=20=20
<!-- |**|begin egp html banner|**| -->
<br>
=20=20=20
=20=20=20=20=20
=20
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-fam=
ily: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tr=
ansform: uppercase; "><a href=3D"https://groups.yahoo.com/neo/groups/Simple=
ORM/info;_ylc=3DX3oDMTJlcThrOGcxBF9TAzk3MzU5NzE0BGdycElkAzczNjAyMjYEZ3Jwc3B=
JZAMxNzA1MDA2OTA1BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTQxNjQ3Mjk3MA--" style=3D=
"text-decoration: none;">Visit Your Group</a></span>
<ul style=3D"list-style-type: none; margin: 0; padding: 0; display: in=
line;">
</ul>
</div>
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
<a href=3D"https://groups.yahoo.com/neo;_ylc=3DX3oDMTJkOXVic2JwBF9TAzk3ND=
c2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlYwNmdHIEc2xrA2dmcARzd=
GltZQMxNDE2NDcyOTcw" style=3D"float: left;"><img src=3D"http://l.yimg.com/r=
u/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height=3D"15"=
width=3D"137" alt=3D"Yahoo! Groups" style=3D"border: 0;"/></a>
<div style=3D"color: #747575; float: right;"> • <a href=3D"https://i=
nfo.yahoo.com/privacy/us/yahoo/groups/details.html" style=3D"text-decoratio=
n: none;">Privacy</a> • <a href=3D"mailto:SimpleORM-unsubscribe@yahoog=
roups.com?subject=3DUnsubscribe" style=3D"text-decoration: none;">Unsubscri=
be</a> • <a href=3D"https://info.yahoo.com/legal/us/yahoo/utos/terms/"=
style=3D"text-decoration: none;">Terms of Use</a> </div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
=20=20=20
<br>
<!-- |**|end egp html banner|**| -->
<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</body>
</html>
--001a113d42dc03ece905084650c6--