RE: [Actionframework-users] processing order suggestion
Status: Inactive
Brought to you by:
ptoman
From: Jakub C. <bla...@cb...> - 2003-05-15 10:45:56
|
> I think you can put the db cleanup code into: > 1) overriden requestCleanup() method of ActionServlet, This looks OK, I will try to go this way. > 2) destroy() method of a component with "request" persistence that implements Destroyed interface. This is also good idea, but I have my actions bound to methods of 'session' scoped component so I would have to create that special component from inside other component via as.getComponent() - which seem little dirty to me. I would really suggest to have something like <post-render-invoke> in some future release. ---------------------------------------------------------------------------- --------------------------------- <dreaming> One more question/suggestion: It would be really nice to have some way of accessing AS components from any class. I know that JNDI is planned, that would be great! I was thinking about some class with static AS component accessors, but I didn't succeed. Imagine this: You have AS component "PersistenceManager" with session scope. This component has all the DB specific stuff in it. Then you create your datamodel classes according to ActiveRecord pattern, so you have methods like person.persist() person.delete() etc. And you can implement these methods (in common BaseClass!) like: void persist() { pm = somehowGetASComponent("PersistenceManager"); pm.save(this); } It seems to me that now the only way is to pass AS to all classes in constructor which looks quite ugly... </dreaming> Many greetings to you all! Jakub Cerny |