I totally agree with you Viktor! ... although it seems like a workable
solution in this case a Record contains to distinct entities to
represent the same data and of course the boilerplate.

It was mentioned above compiler plugins which I expressed my opinion
about it (I'd stay away) but there might be another way to "alter" the
bytecode at runtime. I'm talking about dynamic class weaving.
Basically it is a class loader that before returning the actual
updated class. Kind of what AspectJ is doing. A while ago a wrote a
bytecode level manipulation framework and combined with a "special"
classloader I was able to modify a class dynamically and use it.

Of course there are caveats:

1. Complexity induced by bytecode level manipulation
2. How a dynamic class loader cope with container's classloader that
essentially loads the web application. Of course it would delegate the
loading to the container's classloader but these "modifiable" classes
should probably not live in WEB-INF/classes or WEB-INF/lib folder.


But all in all I'm not convinced that this effort really worth it.
AFAIC I still don;t get the whole point of integrating Record/Field
with JPA. If someone wants to switch easily from JPA to Record or vice-
versa, to have this flexibility perhaps consider to abstract these
layers from the rest of the application and using other persistence
technologies would not affect the application "business logic" ... but
this is about how the appliation is designed etc.

Br's,
Marius

On Nov 30, 9:56 am, "Viktor Klang" <[EMAIL PROTECTED]> wrote:
> IMHO:
>
> " [EMAIL PROTECTED] name = "my_name"}
>   var name : String = _
>   object nameField extends StringField(this,100) with Delegated
>   nameField.delegate(name, name = _)"
>
> That's just too much boilerplate. For me, who went to scala to lose
> boilerplate, this is not a viable solution.
>
> Unfortunately the JPA spec is kind of weak when it comes to adaptation, so
> my suggestion to make it work with Hibernate first still stands.
>
> What do you guys think?
>
> Cheers,
> Viktor
>
> On Sat, Nov 29, 2008 at 10:23 PM, Derek Chen-Becker
> <[EMAIL PROTECTED]>wrote:
>
>
>
> > No big deal. In the example code I did a by-name in the delegate method so
> > at least it's transparent to the end-user.
>
> > Derek
>
> > On Sat, Nov 29, 2008 at 11:06 AM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>
> >> Just wanted to chime in real quick...
>
> >>> type Getter = () => MyType // Can this be by-name in any way?
>
> >> No. By-names are not first-class types. It's gotta be () => MyType
>
> >> --j
>
> --
> Viktor Klang
> Senior Systems Analyst
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to