The persistent framework in my app is completely
abstracted away.  Not sure how you designed your
system, but the only layer in my architecture that
knows I'm using Hibernate are my DAO implementations. 
I have a service layer which uses each DAO's
interface, so even my service layer has no idea about
my persistent framework.  If I chose to write the
persistent layer in JDBC, it would be very simple,
since all I'd have to do is implement my DAO
interfaces and change what implementation to use. 
Anyway, it's definitely possible.

--Andrew

--- Gili <[EMAIL PROTECTED]> wrote:

> 
>       Contrary to what you might read online, it is
> impossible to fully 
> abstract away your persistent framework. Take
> Hibernate for example, if 
> you are inserting large objects you will have
> manually flush/clear your 
> session every X inserts to avoid running into
> OutOfMemoryErrors. Other 
> frameworks handle this differently (in db4o for
> example, they use weak 
> references so you never run out of memory). Every
> framework seems to 
> have its own little "quirk" and you end up with
> leaky abstractions.
> 
>       In my use-case, it makes a lot of sense to bundle
> DB-aware methods with 
> the POJO. For example, normally your POJO would be:
> 
> class Theme
> {
>    public String getName();
>    public void String setName();
> }
> 
>       but I go further:
> 
> class Theme
> {
>    public String getName();
>    public void String setName();
>    public Theme getCanonicalInstance();
> }
> 
>       where getCanonicalInstance() is DB-aware. There are
> a lot of helper 
> functions that manipulate or operate on themes and I
> bundle them with 
> class Theme. This simplifies my code a great deal in
> exchange for the 
> lack of separation between the persistence and data
> layer (which is fine 
> with me). Your use-case might differ <shrug>
> 
> Gili
> 
> Igor Vaynberg wrote:
> > The pojos are great, it's the save and load
> methods that I was referring to.
> > 
> > -Igor
> > 
> > 
> > 
> >>-----Original Message-----
> >>From: [EMAIL PROTECTED] 
> >>[mailto:[EMAIL PROTECTED]
> On Behalf Of 
> >>Timo Stamm
> >>Sent: Friday, October 07, 2005 4:43 PM
> >>To: wicket-user@lists.sourceforge.net
> >>Subject: Re: [Wicket-user] Standard for database
> integration? 
> >>(Please!)
> >>
> >>Igor Vaynberg wrote:
> >>
> >>>Having code like this
> >>>
> >>>Class Person {
> >>>   private long id;
> >>>   private String username;
> >>>   private String firstname;
> >>>   private String lastname;
> >>>   
> >>>   ...getters/setters...
> >>>
> >>>   public void save() {...}
> >>>   public void loadById(long id) {...}
> >>>}
> >>>
> >>>Can be done with anything from hibernate to db40
> to jdbc - 
> >>
> >>its still a 
> >>
> >>>poor way to write an application.
> >>
> >>
> >>I don't like having to create a class for each
> data entity. 
> >>On the other hand, those bean-style POJOs are very
> common and 
> >>supported by various frameworks.
> >>
> >>Can you give reasons for your opinion?
> >>
> >>
> >>Timo
> >>
> >>
>
>>-------------------------------------------------------
> >>This SF.Net email is sponsored by:
> >>Power Architecture Resource Center: Free content,
> downloads, 
> >>discussions, and more.
> http://solutions.newsforge.com/ibmarch.tmpl
> >>_______________________________________________
> >>Wicket-user mailing list
> >>Wicket-user@lists.sourceforge.net
>
>>https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >>
> >>
> > 
> > 
> > 
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Power Architecture Resource Center: Free content,
> downloads, discussions,
> > and more.
> http://solutions.newsforge.com/ibmarch.tmpl
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/wicket-user
> > 
> 
> -- 
> http://www.desktopbeautifier.com/
> 
> 
>
-------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content,
> downloads, discussions,
> and more.
> http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/wicket-user
> 



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to