[Dev-sig] Hibernate
Robert Leyva
mrflash818 at geophile.net
Thu Oct 26 13:20:35 PDT 2006
take a look at Hibernate.org
It is a framework to create DAOs and generate db code for you, so quirks
can be factored out from your efforts
> [redirected to Devsig]
>
> -----Original Message----- Of Jana Lingo
>
> On a more advanced note:
> I'm working on a project on my own to get my Java skills beyond the
> "hello world" stage. This has a DBMS component. My question is should I
> embed the SQL stuff in the object classes or segregate them into a
> Database object? I'm leaning towards the latter. Jana
> ========================I would wrap the database calls in some form of
> object -- "SQL", as
> universal as it may seem, still has some "quirks" between database
> engines. There will come a day when "the database" changes (say from
> mysql to postgresql, or even oracle 8i to oracle 9i...) and you'll find
> that some syntax somewhere has to be changed. Which would you rather
> do: fix one component or repeatedly fix the same line of code everywhere
> it occurs?
>
> You may also find (at some point) that using a database for one or more
> tables is overkill (maybe a flat file will do, or if only used for
> temporary stuff, kept in memory) by wrapping the DB calls into an
> object, you can change that object to use "something else" without
> redesigning your entire program...
>
>
--
"Knowledge is Power" -- Francis Bacon
Robert Leyva
mrflash818 at geophile.net
More information about the Dev-sig
mailing list