It often makes me wonder, when people talk down on JDBC and patterns, what the 
real problem is.  The way I see it, there are 2 main objectives in a reasonably 
high level language like Java:
1. to let you consume API; and
2. to let you author your own API.

That means one has a choice of consuming someone else's or their own libraries. 
 
JDBC is a standard library for talking to relational databases with many known 
implementations.  It's fairly low-level and the differences in implementation 
focus on letting one talk to different kinds of databases or transparently 
adding certain performance benefits, like connection pooling.  All that is 
rather straightforward.

>From there, one has to ask and answer whether they want to consume JDBC API 
itself or something else.  Almost always, the answer is something else.  But 
why?  There's been this consistent buzz about ORM (not that it isn't a good 
concept in and of itself) and naturally, as programmers tend to do, 
general-purpose libraries and frameworks started to arise.  Almost all of them 
came from people having found a satisfactory solution to their own problem and 
maybe genericizing it somewhat.  EJB I guess was a little different, as it was 
a 
standard developed by committee during the heyday of "someday there 
configuration will replace all coding" enterprise development craze.

I think the exercise in generic ORM frameworks is largely a failure at this 
point.  It is easy to create simple small frameworks on top of JDBC itself that 
may or may not be specific to the project at hand.  They typically do not 
suffer 
much from performance overhead, are completely understandable to the 
development 
shop, and provide enough abstraction to be useful without trying to pretend 
like 
it's not a RDBMS on the other end.  I've come to really appreciate that last 
point.  The best programmers are both engineers and computer scientists and 
sometimes those two roles clash.  It's important to make sure the engineer 
listens to the scientist, but sometimes we have to let the engineer do his or 
her thing.  I find that with persistence solutions, it is all too easy to get 
into the trap of trying to distance yourself from the relational algebra for 
very subjective reasons only to pay a price for it later.  This thought may or 
may not have a bearing in the overall language discussion in this thread.

 Alexey





________________________________
From: Liam Knox <[email protected]>
To: [email protected]
Sent: Tue, August 10, 2010 8:08:34 AM
Subject: Re: [The Java Posse] Re: Scala is complete esoteric nonsense!

What a fantastic example how DSL's can got completely mental.
Its like letting really mad people inventing API's but going for the Nuclear 
option.

Keep the surface area down.  
Don't buy the argument that being able to create a million mini languages is 
somehow going to help us one bit.
It is not, its mean complexity will explode

P.S. Persistence seems quite a nostalgic example given the amount of companies 
and developers that end up back with straight JDBC after that terrible, 
terrible 
EJB debacle ;-)


On Mon, Aug 9, 2010 at 6:09 AM, Mario Fusco <[email protected]> wrote:

> And why does everyone keep talking about DSL's?
>
>Let me give you an example of a wonderful DSL written in Scala:
>
>http://wiki.github.com/alaz/mongo-scala-driver/
>
>As you can easily understand this is the Scala driver for MongoDB.
>Just note the small code examples you can find in the home page of the
>project. You can find gems like:
>
>// Skip first 5 and get 2 users
>for {val u <- User drop 5 take 2 in users} ...
>
>and
>
>// Query by regexp
>val endingBy5 = User.name ~ "r5$".r in users
>
>Can you imagine a more readable DB driver? Wouldn't you be more
>productive with it if you were involved on project that uses MongoDB?
>
>Bye,
>Mario
>
>twitter: @mariofusco
>
>--
>You received this message because you are subscribed to the Google Groups "The 
>Java Posse" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to 
>[email protected].
>For more options, visit this group at 
>http://groups.google.com/group/javaposse?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.



      

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to