Re: OOP/OOD Philosophy



frebe wrote:

> > How long does it take to write an ODBC driver?
>
> I don't know about ODBC, but for JDBC it is very simple. It's a number
> of interfaces that you have to implement. Using Eclipse, it is done in
> less than an hour. Once you have done a JDBC that wrapps the real
> driver, you can easily inject your exception throwing code. The key
> things is that you only have to implement your driver once (if you
> don't find anyone who did it before), not for every application.
>
> Making wrapping JDBC drivers is also an excellt way to overcome
> differences between database vendors.

I think many of your discussions target publishable library code.

When we write application-specific code, it should have the narrowest
interface possible. So I would not inherit JDBC [or the equivalent] and pass
thru all of its methods. I would wrap JDBC in something with only the fewest
methods that our application needs. Then I'd mock that.

Yes, sometimes mocking the published library is easy, and sometimes the
published library should also publish its wide interfaces that hide
differences between database vendors. But without the requirement to publish
a complete library, application-specific techniques get very lean.

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand


.



Relevant Pages

  • Re: Unable to load JdbcOdbc library
    ... > expose a JDBC interface, ... > Using ODBCTEST program that comes with the Solaris ODBC driver, ... network protocol accessible. ...
    (comp.lang.java.databases)
  • Re: Possible Type Conversion Defect
    ... Specifically we are breaking due to the lack of conversion from BIGINT to ... Microsoft SQL Server 2000 JDBC driver. ... I'll agree that the JDBC API specifications could be a bit more precise. ... a JDBC driver attempts to convert the underlying data to the Java ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: OOP/OOD Philosophy
    ... >> How long does it take to write an ODBC driver? ... but for JDBC it is very simple. ... >driver, you can easily inject your exception throwing code. ... "The aim of science is not to open the door to infinite wisdom, ...
    (comp.object)
  • Re: Ora10 JDBC Driver with TIMESTAMP WITH LOCAL TIME ZONE
    ... >> Robert Klemme wrote: ... >>> driver is the newest driver for Ora 10.2. ... >>> JDBC driver I suspect it's a JDBC driver issue. ... > sets the session time zone of the connection and saves the session ...
    (comp.databases.oracle.misc)
  • Re: federate several datasources
    ... >>I want to federate several physical datasources, ... >>its JDBC driver. ... >>My idea is that this aggregator could be implemented as a special JDBC ... open-source databases such as MySQL, PostGreSQL, but this is outside the ...
    (comp.lang.java.databases)