You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alfonso Quiroga <al...@gmail.com> on 2009/11/14 06:56:26 UTC

tapestryIoC + architecture

Hi! I've been using java for 3 years aprox, and when I was working on
projects, we used to have this projects (architecture)

project-common (model, and services)
project-server (services implementations!)
project-web (we used struts2 so... jsp, actions, etc)

I had a good architect, he used maven, and spring. Dependencies are:
server can see common... and web can see common...
That was good because in the WEB layer you could NEVER see any class
of the server layer (that is ok). As we use spring, there was no
problem because in RUNTIME all beans were wired (via XML)

My question about tapestryIoC is... it doesn't use XML (I love that)
but if I'm in web layer (i.e. AppModule.java) and I want to reference
a server implementation, I CAN'T. I need via programming to do this:
   binder.bind(common.LoginService.class, server.LoginServiceImpl.class)

but I can't see LoginServiceImpl.class... my patch/workaround by now
is.. I let web-layer see the server-layer, but that is not happy. Any
suggestions? Thanks and sorry for my bad english!

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


Re: tapestryIoC + architecture

Posted by Alfonso Quiroga <al...@gmail.com>.
Oh thanks, it was really easy and I didn't saw it, thanks again

On Sat, Nov 14, 2009 at 3:19 AM, Kalle Korhonen
<ka...@gmail.com> wrote:
> On Fri, Nov 13, 2009 at 9:56 PM, Alfonso Quiroga <al...@gmail.com> wrote:
>> My question about tapestryIoC is... it doesn't use XML (I love that)
>> but if I'm in web layer (i.e. AppModule.java) and I want to reference
>> a server implementation, I CAN'T. I need via programming to do this:
>>   binder.bind(common.LoginService.class, server.LoginServiceImpl.class)
>> but I can't see LoginServiceImpl.class... my patch/workaround by now
>> is.. I let web-layer see the server-layer, but that is not happy. Any
>> suggestions? Thanks and sorry for my bad english!
>
> One of the many great things in Tapestry-ioc is autoloading modules.
> You can happily create ServicesModule where you put
> binder.bind(common.LoginService.class, server.LoginServiceImpl.class)
> etc. binding calls, then just use that module in your webapplication
> (add as dependency, inject services as needed), never having to expose
> the implementation classes to your web app. See
> http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html for
> reference.
>
> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: tapestryIoC + architecture

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Nov 13, 2009 at 9:56 PM, Alfonso Quiroga <al...@gmail.com> wrote:
> My question about tapestryIoC is... it doesn't use XML (I love that)
> but if I'm in web layer (i.e. AppModule.java) and I want to reference
> a server implementation, I CAN'T. I need via programming to do this:
>   binder.bind(common.LoginService.class, server.LoginServiceImpl.class)
> but I can't see LoginServiceImpl.class... my patch/workaround by now
> is.. I let web-layer see the server-layer, but that is not happy. Any
> suggestions? Thanks and sorry for my bad english!

One of the many great things in Tapestry-ioc is autoloading modules.
You can happily create ServicesModule where you put
binder.bind(common.LoginService.class, server.LoginServiceImpl.class)
etc. binding calls, then just use that module in your webapplication
(add as dependency, inject services as needed), never having to expose
the implementation classes to your web app. See
http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html for
reference.

Kalle

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