You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by maxthesecond <ma...@yahoo.com> on 2008/05/08 21:38:11 UTC

T5 ASO & Services

How I'm suposed to get services inside an ASO?

I placed my DAO objects in services I didn't need any sesion so far, but at
a certain point I need an ASO the wich needs to make use of my DAO services.

btw I've notice an old post in wich the willing was the oposit; how to acces
the ASO from a Services, such is the destiny of frameworks: give
satisfaction to all needs....

Thanks and never mind  !
-- 
View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17134860.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 ASO & Service

Posted by maxthesecond <ma...@yahoo.com>.
Well I just wandered about serialization issues, but better for me if it's
not a problem, at the end I added my Service as a parametrer in the ASO:


MyASO.addproducttoChart(idProduct,MyServices)
{
     Map<Integer,Product> _chartMap;
     Product p=MyServices.getProductById(idProduct);
     _chartMap.put(idProduct,p);
}

It is unclear for me how to inject those services in the
ApplicationStateCreator, and also which will be they time scope...in the way
I did I now that the service has been "freshly" injected in the page, but
really this I still don't get it full.

Thanks 








Filip S. Adamsen-2 wrote:
> 
> What? It's not uncommon to have methods on an ASO. You can also inject 
> services into it when creating it if you use an ApplicationStateCreator. 
> The relevant docs on Application State has an example at the bottom.
> 
> -Filip
> 
> maxthesecond skrev:
>> oopss!
>> I think I missed the point
>> the ASO aplication state object is merely a container for sharing
>> information across pages and time it shall not have metods, so I'll do as
>> you say.
>> thanks again
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17145265.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 ASO & Service

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
What? It's not uncommon to have methods on an ASO. You can also inject 
services into it when creating it if you use an ApplicationStateCreator. 
The relevant docs on Application State has an example at the bottom.

-Filip

maxthesecond skrev:
> oopss!
> I think I missed the point
> the ASO aplication state object is merely a container for sharing
> information across pages and time it shall not have metods, so I'll do as
> you say.
> thanks again

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


Re: T5 ASO & Service

Posted by maxthesecond <ma...@yahoo.com>.
oopss!
I think I missed the point
the ASO aplication state object is merely a container for sharing
information across pages and time it shall not have metods, so I'll do as
you say.
thanks again
-- 
View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17141903.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 ASO & Service

Posted by maxthesecond <ma...@yahoo.com>.
Sounds good, if it's simply imposible to use services within ASO I'll do
that, but I found more natural the other way arround:

In the Page
_MyAso.addproductttoChart(id);

In the ASO
MyASO.addproducttoChart(idProduct)
{
     Map<Integer,Product> _chartMap;
     @Inject private MyServices _MyServices;
     Product p=_MyServices.getProductById(idProduct);
     _chartMap.put(idProduct,p);
}

Instead of

In my Page

@Inject _MyServices
@AplicationState _MyAso

_MyServices.AddProductToChart(idProduct,_MyAso.getMap());

And in services
......
MyServices.AddProductToChart(idProduct,map<Integer,Product>){      
      Product p=_MyServices.getProductById(idProduct);
     _chartMap.put(idProduct,p);
}

It's basically the same but imho in the first model the separation of
responsabilities is higher and keeps the service DAO lean.

thanks for yor answer!




Bill Holloway wrote:
> 
> Of course, you'll have the went-to-null trouble even passing the bits
> of data into your service as method args :)
> 
> On Thu, May 8, 2008 at 2:38 PM, maxthesecond <ma...@yahoo.com> wrote:
>>
>> How I'm suposed to get services inside an ASO?
>>
>> I placed my DAO objects in services I didn't need any sesion so far, but
>> at
>> a certain point I need an ASO the wich needs to make use of my DAO
>> services.
>>
>> btw I've notice an old post in wich the willing was the oposit; how to
>> acces
>> the ASO from a Services, such is the destiny of frameworks: give
>> satisfaction to all needs....
>>
>> Thanks and never mind  !
>> --
>> View this message in context:
>> http://www.nabble.com/T5-ASO---Services-tp17134860p17134860.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
>>
>>
> 
> 
> 
> -- 
> Bill @ PeoplePad
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17141809.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 ASO & Service

Posted by Bill Holloway <bi...@peoplepad.com>.
Of course, you'll have the went-to-null trouble even passing the bits
of data into your service as method args :)

On Thu, May 8, 2008 at 2:38 PM, maxthesecond <ma...@yahoo.com> wrote:
>
> How I'm suposed to get services inside an ASO?
>
> I placed my DAO objects in services I didn't need any sesion so far, but at
> a certain point I need an ASO the wich needs to make use of my DAO services.
>
> btw I've notice an old post in wich the willing was the oposit; how to acces
> the ASO from a Services, such is the destiny of frameworks: give
> satisfaction to all needs....
>
> Thanks and never mind  !
> --
> View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17134860.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
>
>



-- 
Bill @ PeoplePad

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


Re: T5 ASO & Service

Posted by Bill Holloway <bi...@peoplepad.com>.
Max,

What I do in my app is pass the relevant bits of ASO data into my
service methods as arguments.  You could pass the entire ASO, but you
might risk having it go null on you if the ASO gets set to null
somewhere.

Bill

On Thu, May 8, 2008 at 2:38 PM, maxthesecond <ma...@yahoo.com> wrote:
>
> How I'm suposed to get services inside an ASO?
>
> I placed my DAO objects in services I didn't need any sesion so far, but at
> a certain point I need an ASO the wich needs to make use of my DAO services.
>
> btw I've notice an old post in wich the willing was the oposit; how to acces
> the ASO from a Services, such is the destiny of frameworks: give
> satisfaction to all needs....
>
> Thanks and never mind  !
> --
> View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17134860.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
>
>



-- 
Bill @ PeoplePad

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