Menu

#237 EL at runtime (SpEl)

open
nobody
5
2011-09-19
2011-09-19
arnolf
No

Hi,

first I would like to thank you for the work you\'ve done ! Great idea and great job !

I worked on a project where we needed a lots of custom converters and it was really a pain.

So we made a generic custom converter with parameter to execute script as we need. So I\'m asking you, why don\'t integrate an expression langage at runtime such as Spring EL ?

Spring EL is running very fast and has some interesting features. For example we could write :

<field>
<a>#{@userServiceImpl.hello(#src?.name)}</a>
<b>role</b>
</field>

where @userServiceImpl is the spring bean ; #src is the source object - #\'{} to indicate that a script expression, and of course the mapping field should be unidectionnal.

Spring EL as some nice feature such as calling method on bean services, null-safe operator, collection projection etc...

By introducing Spring EL, it could be interesting to also add context variables, for example :

<field>
<a>#{@userServiceImpl.hello(#src?.name, #context)}</a>
<b>role</b>
</field>

and mapper.map(src.class, dest, context)

Of course we could write also :

<field>
<a>zone</a>
<b>#{@userServiceImpl.hello(#src?.name, #context)}</b>
</field>

Regards.

Discussion


Log in to post a comment.