Joern, are you using MegaProtoUser? If so, I dramatically simplified
our access control code by using the superUser property it provides,
though I can't say whether that'd be useful for you. Also, what you
describe kind of reminds me of App Engine's Expando models (http://
code.google.com/appengine/docs/python/datastore/expandoclass.html).
While I don't think you can easily (or necessarily would want to)
implement it, it might provide some inspiration.

Peter

On Dec 10, 2:46 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> The business logic/interfaces on your Scala classes do not need to match the
> DB.  For example:
>
> class MyFoo extends LongKeyedMapper[MyFoo] with IdPK {
>   def getSingleton = MyFoo
>
>   protected object name extends MappedString(this, 64)
>   protected object age extends MappedInt(this)
>
>   def info: (String, Int) = (name.is, age.is)
>
>   def info_=(info: (String, Int)): Unit = {
>     name.set(info._1)
>     age.set(info._2)
>   }
>
> }
>
> object MyFoo extends MyFoo with LongKeyedMetaMapper[MyFoo]
>
> So, you've got 2 columns in your database, but the Scala MyFoo class doesn't
> expose those columns... instead, it exposes the info method.
>
> Does this give you what you want?
>
> Thanks,
>
> David
>
>
>
>
>
> On Thu, Dec 10, 2009 at 12:18 PM, Joern <joern.bernha...@gmx.net> wrote:
> > > Why do these fields have to be "taped together"?  What is "taped
> > together"?
>
> > > Why not just create a method that takes a user and updates the correct
> > > columns in the record?
>
> > Sorry if "taped together" didn't make sense - I wanted to say that
> > they belong together and should be seen as one Unit instead of two
> > columns which need to import extra logic (with the method) to be bound
> > together. If I use a method, I still have to add the two columns,
> > initialize it with proper names and default values every time I want
> > to use that logic. It still feels like a workaround as I have
> > repetitive code, which results in copy & paste, what I want to avoid
> > as much as possible.
>
> > But ok, I'll use that workaround since I don't really see another way,
> > if it's not possible to put something like a wrapper around two
> > MappedFields.
>
> > > > I hope that information helps understanding my problem...
>
> > > Not really.  English is a very bad vehicle for design.  Please give us
> > your
> > > schema or the interfaces at the Scala level.
>
> > My code got really complex and I'm not sure what interfaces I should
> > post here. I thought I already posted the relevant parts with the
> > InstanceUser schema in the example... :S
>
> > Thanks,
> > Joern
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com 
> > >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> 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

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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