Bin,

I've forgot to paste this link in the last email, it was my failure. The
link follows http://code.google.com/p/google-guice/wiki/GuicePersist.

What I meant explaining that is that you can use JPA as your persistence
layer and use the Hibernate under JPA as a persistence provider. You'll need
to create a persistence.xml saying what will be your datasource (it
abstracts the creation of a connections pool), and doing this you'll make
your application more portable. You'll also have transactional
implementation and persistence context totally out of the box.

I hope this help. :)

Atenciosamente,

*Jayr Motta*
Software Developer
*
*
I'm  on 
BlackBeltFactory.com<http://www.blackbeltfactory.com/ui#!User/jmotta/ref=jmotta>
!



On Tue, May 10, 2011 at 8:07 PM, Bin Wu <[email protected]> wrote:

> Hey Jayr,
>
> Thanks for your detailed explanation about Java EE. I think my specific
> question is more about how to use Guice within the DAO. In a webapp, we
> should better control the DB session outside the DAO? So I am currently have
> no idea how to do this, had googled around but haven't found any good
> examples. So if anyone can show me some very simple pieces of code that
> would be great. Anyway, thanks again.
>
>
> On 11 May 2011 03:41, jMotta <[email protected]> wrote:
>
>> Bin,
>>
>> I always like to think on IoC as a mechanism to abstract any code that
>> isn't related to my business, I also think that most part of the application
>> servers do something in this way, moving the responsibility of coding some
>> infrastructure coding to the server instead making the developer worry about
>> this kind of boring boilerplate code. But the price for this is the
>> dependency of the container, some of them make your application be stucked
>> in a single version of this application server given its particularities and
>> it's somehow against the WORA, so you must let just the heavy infrastructure
>> in the application server (JEE), like load balancing, clustering and so on.
>>
>> You must also keep in mind that JPA itself isn't part of JEE, it was
>> projected to either outside or inside an application server. I'm saying this
>> because it's the closer that your explanation arrives of an JEE application
>> compliance while using Hibernate, that's a framework with the same
>> implementation line of the most modern implementations of JPA.
>>
>> Anyway, I just said all this to make sure that you don't get confused
>> about stuffs either inside (JEE) or outside the box. I also have an
>> application that uses the same architecture that you've described besides
>> the Hibernate part, I use low-level API of Datastore (that uses datanucleus
>> to translate to GQL) in the Google AppEngine platform.
>>
>> Any doubt, count on us! :)
>>
>> Atenciosamente,
>>
>> *Jayr Motta*
>> Software Developer
>> *
>> *
>> I'm  on 
>> BlackBeltFactory.com<http://www.blackbeltfactory.com/ui#!User/jmotta/ref=jmotta>
>> !
>>
>>
>>
>> On Tue, May 10, 2011 at 4:02 AM, Bin Wu <[email protected]> wrote:
>>
>>> Hello everyone,
>>>
>>> I am pretty new to Guice and even J2EE, and I am currently trying to
>>> build a webapp which ues (GWT, Google-gin, gwt-platform, Guice, Hibernate
>>> etc.). My problem here is, at the server side, I am bit confused about how
>>> those components can collaborate with each other in a  good manner. Anyone
>>> here has a good example which uses Guice, Hibernate and a DAO layer?
>>>
>>> Thanks a lot.
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-guice" 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/google-guice?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" 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/google-guice?hl=en.
>>
>
>
>
> --
> Regards,
>
> Bin Wu | *BluePoint *| 03 9296 5100 | 0423 710 288 | *www.bluepoint.net.au
> * <http://www.bluepoint.net.au/>
>
> BluePoint has Gone *Google*!
>
> *Each day, thousands of companies are going Google by switching to Google
> Apps – a web-based suite of messaging and collaboration applications. It's
> all hosted by Google, and designed with security and reliability in mind,
> saving your company the frustrations and hassles of managing traditional IT
> solutions yourself.** Call BluePoint for more information or view the cloud
> calculator <http://www.gonegoogle.com> to calculate your potential
> business savings.*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-guice" 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/google-guice?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" 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/google-guice?hl=en.

Reply via email to