Why do you have two classes, Model and Record? What are they and why are they 
interdependent?

-------------------------------------
David Pollak<feeder.of.the.be...@gmail.com> wrote:

On Mon, Oct 12, 2009 at 1:55 AM, Oleg G. <ojo...@gmail.com> wrote:

>
> I spent some time and came up with this code:
> http://github.com/ojow/Random-code/blob/master/Test.scala
> I think it should allow all the needed stuff, it keeps meaning with
> the bytes and also:
> * its reusable and extensible in many directions
> * looks like generated .class files don't have any additional hidden
> fields or heavy methods, so it's technically light-weight
> * it doesn't need reflection (not sure if its good or bad :)
>
> Would be nice to hear some feedback on that.
>
> P.S. I'm still a newbie in Scala so please excuse me if this code is
> worthless and if i'm just wasting your time.
>

Oleg,

I wrote the existing Mapper code when I was 2-3 weeks into Scala.  It's very
Javaesque.

Your code is interesting, but the complexity of what the developer has to
type would make it pretty difficult to use in practice.  Sorry.

David


>
> On Oct 7, 3:54 am, David Pollak <feeder.of.the.be...@gmail.com> wrote:
> > On Tue, Oct 6, 2009 at 10:16 AM, Oleg G. <ojo...@gmail.com> wrote:
> >
> > > As i said before i'm not sure that i'm getting the whole picture and
> > > maybe my initial question is incorrect in its root. Still:
> >
> > > Suppose i have a Person class declared with Mapper/Record and i want
> > > to reuse the class and all the code associated with it in another
> > > module/project. My first thought was to extend the Person class and
> > > override some of its fields by mixing in some additional traits (see
> > > my simplified example code in the initial message). But i noticed that
> > > inner objects cannot be overriden (its not obvious for me but i can
> > > get it if i dig it).
> >
> > You can't do this.  There was a Scala language feature that would have
> > allowed this (overriding an object) but it hasn't made the cut for 2.7 or
> > 2.8.
> >
> >
> >
> > > So how do i reuse Mapper/Record based code if i need to extend/
> > > customize the data structures?
> >
> > Unfortunately, you can't.  Once you've got a field defined, there's
> nothing
> > you can do to change it in a subclass.
> >
> >
> >
> >
> >
> >
> >
> > > On Oct 6, 11:59 pm, David Pollak <feeder.of.the.be...@gmail.com>
> > > wrote:
> > > > On Tue, Oct 6, 2009 at 9:50 AM, Oleg G. <ojo...@gmail.com> wrote:
> >
> > > > > Thanks for all the answers and especially for David's
> clarification.
> > > > > It would be really cool to upgrade the 'keeping the meaning with
> the
> > > > > bytes' thing (
> http://blog.lostlake.org/index.php?/archives/19-Keeping-
> > > > > the-meaning-with-the-bytes.html) to allow extension/customization.
> >
> > > > What kind of extensions/customizations?
> >
> > > > MappedXXX can all be subclassed, extended and customized.
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics



--~--~---------~--~----~------------~-------~--~----~
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to