Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Won't Do
-
3.2.0
-
None
Description
To get rid of a bit of legacy and make the usage of the CNB more intuitive, these could be nice improvements (from an email by Woonsan):
I think we can improve the following:
- ContentNodeBinder could be parameterized like ContentNodeBinder<T
extends HippoBean>. So no casting is necessary. - Maybe we can introduce a new interface, ContentBeanBinder which has
only #bind(Node) like you mentioned. So, wpm can check whether or not
the interface implemented in addition.
In the second case the code in the bean could be much simpler:
@Override public boolean bind(Object content, javax.jcr.Node node) throws ContentNodeBindingException { try { node.setProperty("myhippoproject:username", getUsername()); } catch (Exception e) { log.error("Unable to bind the content to the JCR Node" + e.getMessage(), e); throw new ContentNodeBindingException(e); } return true; }
Attachments
Issue Links
- relates to
-
HSTTWO-3374 Update ContentNodeBinder interface to make it more clear
- Closed