[conversion] Generic bean converter
-----------------------------------

                 Key: LABS-235
                 URL: https://issues.apache.org/jira/browse/LABS-235
             Project: Labs
          Issue Type: Bug
          Components: Magma
    Affects Versions: Current
            Reporter: Simone Gianni
            Assignee: Simone Gianni
             Fix For: Future


Currently Magma handles stuff in the web session correctly : it converts those 
values using converters, and reconverts them back when needed. This way, there 
is no serialization problem, and there is no JPA detached problem, because the 
object in the session will be re-fetched from the DB when needed in subsequent 
requests.

The problem arise when we save in the session in a bean that does not have a 
converter, and even worse if this bean itself contains field which are JPA 
entities. In that case, Magma will hold the bean in the session, since that's 
perfectly legal, but those objects will became detached. 

A possible solution could be a generic bean converter, based on XML or JSON or 
similar to the Hibernate dehydrated representation. This should not use a 
premade library, unless is quite extendable, cause it should use converters 
recursively on the fields of the bean.

The only problem with this approach could be in URL generation. Since converter 
are also used during URL parsing, and they will be used in URL generation when 
cglib will arrive, this would mean exposing the bean internal structure to the 
web. This is NOT a big security concern : most of the current web technologies 
does this without any problem (JSON, web services .. even forms), but it could 
be a functional problem cause URLs are limited in size and have strict parsing 
limitations.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to