You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/12/08 03:51:20 UTC

T5: Tapestry-hibernate and console app

Hi,

Tapestry-hibernate works very well in my t5 app, now I have need to write a
console app that will access the same hibernate data store, how to achieve
this? thanks.

Angelo
-- 
View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tf4965728.html#a14224872
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Tapestry-hibernate and console app

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Davor,

good article, will try it out asap, thanks.


Davor Hrg wrote:
> 
> the sample app,
> tapestry-ioc only console app is ready
> 
> http://wiki.apache.org/tapestry/Tapestry5HowToIocOnly
> 
> I'll make a version that also uses tapestry-hibernate when I catch some
> more
> time for it.
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14263722.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Tapestry-hibernate and console app

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Davor,

Thanks, a good sample, I got better understanding of T5IOC this time,
eagerly waiting for the hibernate version.

A.C.


Davor Hrg wrote:
> 
> the sample app,
> tapestry-ioc only console app is ready
> 
> http://wiki.apache.org/tapestry/Tapestry5HowToIocOnly
> 
> I'll make a version that also uses tapestry-hibernate when I catch some
> more
> time for it.
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14266380.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Tapestry-hibernate and console app

Posted by Davor Hrg <hr...@gmail.com>.
the sample app,
tapestry-ioc only console app is ready

http://wiki.apache.org/tapestry/Tapestry5HowToIocOnly

I'll make a version that also uses tapestry-hibernate when I catch some more
time for it.

Davor Hrg

On Dec 10, 2007 12:22 AM, Davor Hrg <hr...@gmail.com> wrote:

> it's 00:20 here...
>
> I'll make a simple app in the morning
>
> Davor Hrg
>
>
> On Dec 10, 2007 12:16 AM, Angelo Chen <angelochen960@yahoo.com.hk > wrote:
>
> >
> > Hi Davor,
> >
> > That's even better, my #3 is asking for a sample project, now let's say,
> >
> > just a very simple one without tomcat, a service displays "hello", and
> > it is
> > called in a Main method, that will be enough for us to start from there.
> > thanks,
> >
> > A.C.
> >
> >
> > Davor Hrg wrote:
> > >
> > > Hi,
> > >
> > > to use tapestry-ioc in a simple app,
> > > you don't even need tomcat or any web container.
> > >
> > >
> > > IOC container (I simply like tapetry-ioc, like hivemind before it..)
> > > helps simplify putting peaces together and makes separating
> > > code into meaningful peaces more attractive.
> > >
> > > please clarify a bit #3...
> > >
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14244681.html
> >
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: T5: Tapestry-hibernate and console app

Posted by Davor Hrg <hr...@gmail.com>.
it's 00:20 here...

I'll make a simple app in the morning

Davor Hrg

On Dec 10, 2007 12:16 AM, Angelo Chen <an...@yahoo.com.hk> wrote:

>
> Hi Davor,
>
> That's even better, my #3 is asking for a sample project, now let's say,
> just a very simple one without tomcat, a service displays "hello", and it
> is
> called in a Main method, that will be enough for us to start from there.
> thanks,
>
> A.C.
>
>
> Davor Hrg wrote:
> >
> > Hi,
> >
> > to use tapestry-ioc in a simple app,
> > you don't even need tomcat or any web container.
> >
> >
> > IOC container (I simply like tapetry-ioc, like hivemind before it..)
> > helps simplify putting peaces together and makes separating
> > code into meaningful peaces more attractive.
> >
> > please clarify a bit #3...
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14244681.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Tapestry-hibernate and console app

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Davor,

That's even better, my #3 is asking for a sample project, now let's say,
just a very simple one without tomcat, a service displays "hello", and it is
called in a Main method, that will be enough for us to start from there.
thanks,

A.C.


Davor Hrg wrote:
> 
> Hi,
> 
> to use tapestry-ioc in a simple app,
> you don't even need tomcat or any web container.
> 
> 
> IOC container (I simply like tapetry-ioc, like hivemind before it..)
> helps simplify putting peaces together and makes separating
> code into meaningful peaces more attractive.
> 
> please clarify a bit #3...
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14244681.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Tapestry-hibernate and console app

Posted by Davor Hrg <hr...@gmail.com>.
Hi,

to use tapestry-ioc in a simple app,
you don't even need tomcat or any web container.

there are definitive advantages of using tapestry ioc in a small app.
If you want separate concerns in your app, you need granularity,
and have a class(service in tapestry terms) for each task.
One of the first reasons why I (and probably many other) sometimes put
too much code into a single Main class is that connecting
more than few classes is tiresome and often gets clumsy
while trying to get it done too fast.

IOC container (I simply like tapetry-ioc, like hivemind before it..)
helps simplify putting peaces together and makes separating
code into meaningful peaces more attractive.

please clarify a bit #3...

I had to build a web service, and used Axis for it.
then I built a small servlet to start tapestry ioc.
since I did not need tapestry web part I've started the registry
manualy.


Davor Hrg

On Dec 9, 2007 11:07 PM, Angelo Chen < angelochen960@yahoo.com.hk> wrote:

>
> Hi Davor,
>
> That's a good idea, I don't know that we can use Tapestry ioc in non web
> app, now it's really cool, questions:
>
> 1. The app has to be in tomcat server, not in workstation, right?
> 2. What is the advantages of using tapestry-ioc in a non web app?
> 3. it will be nice if you can give a simple project, let's say, to
> continue
> from the Tapestry-hibernate tutorial, just another project that list all
> the
> messages entered by the user, that will be a great help to understand this
>
> non-web T5 app.
>
> Thanks,
>
> A.C.
>
>
> Davor Hrg wrote:
> >
> > Hi,
> >
> > if you don't need tapestry web part,
> > or in other words if you just want tapestry-ioc
> > plus tapestry hibernate:
> >
> > here are simple steps to do it (with maven :) ).
> > this is how I made it work, any suggestions are welcome :)
> >
> >
>
> --
> View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14243862.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Tapestry-hibernate and console app

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Davor,

That's a good idea, I don't know that we can use Tapestry ioc in non web
app, now it's really cool, questions:

1. The app has to be in tomcat server, not in workstation, right?
2. What is the advantages of using tapestry-ioc in a non web app?
3. it will be nice if you can give a simple project, let's say, to continue
from the Tapestry-hibernate tutorial, just another project that list all the
messages entered by the user, that will be a great help to understand this
non-web T5 app.

Thanks,

A.C.


Davor Hrg wrote:
> 
> Hi,
> 
> if you don't need tapestry web part,
> or in other words if you just want tapestry-ioc
> plus tapestry hibernate:
> 
> here are simple steps to do it (with maven :) ).
> this is how I made it work, any suggestions are welcome :)
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tp14224872p14243862.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Tapestry-hibernate and console app

Posted by Davor Hrg <hr...@gmail.com>.
Hi,

if you don't need tapestry web part,
or in other words if you just want tapestry-ioc
plus tapestry hibernate:

here are simple steps to do it (with maven :) ).
this is how I made it work, any suggestions are welcome :)

declare dependancy on tapestry-ioc and tapestry hibernate
there's an open ticket to enable using these two without tapestry-core,
but for now youll have to add dependancy to tapestry-core too.

The thing is you don't need whole TapestryModule :)

in you module add this to
public static void bind(ServiceBinder binder){
...
        binder.bind(ClassNameLocator.class, ClassNameLocatorImpl.class);
...

tapestry-hibernate needs ClassNameLocator to
load all entities from a package

to have your entities ready for use add to your module

    public void
contributeHibernateEntityPackageManager(Configuration<String> configuration)
    {
      configuration.add("your.app.entities");
    }


in you main method run this:

        RegistryBuilder builder = new RegistryBuilder();
        builder.add(MyModule.class);
        IOCUtilities.addDefaultModules(builder);
        registry = builder.build();
        registry.performRegistryStartup();

and you have the registry ready...
you can call
registry.getService(YourService.class)
te get any servise you need


hope this helps...

Davor Hrg





On Dec 8, 2007 3:51 AM, Angelo Chen <an...@yahoo.com.hk> wrote:

>
> Hi,
>
> Tapestry-hibernate works very well in my t5 app, now I have need to write
> a
> console app that will access the same hibernate data store, how to achieve
> this? thanks.
>
> Angelo
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Tapestry-hibernate-and-console-app-tf4965728.html#a14224872
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>