transparent persistence

Discussions

Web tier: servlets, JSP, Web frameworks: transparent persistence

  1. transparent persistence (2 messages)

    I'm trying to develop a pattern for transparent persistence in web applications. At the moment I'm using Struts and Hibernate to develop the application and Xdoclet to create descriptors.

    Whilst it works well, I still seem to be wasting a lot of time writing the same type of code, to locate a DAO and persist the bean. I'd like to be able to devise a method of implementing transparent persistence, in the most
    painless way possible.

    I have been considering using Aspectj (http://www.aspectj.org) to manipulate the beans to insert the callbacks that are needed inform the bean that it
    needs to be persisted. The problem is deciding where I should put the callbacks, i.e. when the bean is finalized it could sync itself with the database (I'm only using this as an example - I don't want to implement it like this). Perhaps I should modify the constructor with an aspect which registers it with a listener that will handle the persistence when the correct callback is made?

    Note - I am sort of thinking out loud, what I want is to create a very simple pattern for this and not get bogged down in creating a JBoss 4 style AOP/CMP style framework!

    Any advice would be greatly appreciated.

    AB
  2. transparent persistence[ Go to top ]

    I've been thinking about it and thought of adding after() advice to the struts action to make sure that the beans that have been used in the actions have been persisted. Any got any views on that?
  3. I've been looking at doing a transparent persistence using aspectj and was wondering how your implementation was working in the struts layer?