Well, an ASO is a "state object" and a service is just that, a service. 
ASOs can have logic in them, but it's hard to give it all the dependencies
it would need.  So, what I do in your situation is have my SecurityContext
service (threaded lifecycle) lookup an ASO (from the
ApplicationStateManager) which holds my current user id (after logging in
I set this).  Then, my pages ask the SecurityContext what the current user
is allowed to do.  I do have to lookup the user each time a request comes
in, but I've told Hibernate to cache those things in the second-level
cache.  Someone asked me to share my code for this before.  I don't knkow
if I ever made an example publically available though.  Maybe I can put
something like this in my "tapernate-example."  I'm trying to beef it up a
bit anyway to show more use cases.

> Hi folks,
>
> a rather simple question I wasn't able to find an answer to on my own:
>
> What's the difference between an ASO and a "normal" HiveMind service
> in terms of it's usage in Tapestry? When should I use an ASO/normal
> service to package some logic?
>
> Both can be simply injected into pages and IMHO seem to provide the
> same "funcionality"...
>
> I want to create a (simple) Security-service (=something checking for
> example that person_A is allowed to load object_B from the database)
> where I can call a method with person_A_id and object_B_id as parameters
> and which throws a SecurityException if necessary. Should I take
> an ASO or is a normal service "enough"?
>
> Thanks!
>   Andreas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


James Carman, President
Carman Consulting, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to