A new era in flexibility of ProtoUser

114 views
Skip to first unread message

David Pollak

unread,
Oct 20, 2010, 1:13:09 AM10/20/10
to liftweb
Folks,

On the dpp_issue_684 branch, I've broken ProtoUser and CRUDify out from Mapper.  They are now living in a separate package, lift-proto and they only depend on webkit.

I've reworked the Mapper version of MetaMegaProtoUser and CRUDify to use these core classes and the same can be done for a Record version of ProtoUser or CRUDify.

I've also changed the mechanism for field definition in ProtoUser such that fields can be over-ridden in subclasses of ProtoUser/MegaProtoUser.  For example:

  override lazy val lastName = new MyLastName(this, 32) {
    override def displayName = "My cat likes tasty yaks"
  }

I'm looking forward to review board approval of the changes so I can push them into master/master_2.7

Thanks,

David

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

adam00

unread,
Oct 20, 2010, 3:56:45 AM10/20/10
to Lift
Fields in CreatedUpdated trait could be open like the one in ProtoUser
too.

Best regards,
Adam


On Oct 20, 7:13 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> Folks,
>
> On the dpp_issue_684 branch, I've broken ProtoUser and CRUDify out from
> Mapper.  They are now living in a separate package, lift-proto and they only
> depend on webkit.
>
> I've reworked the Mapper version of MetaMegaProtoUser and CRUDify to use
> these core classes and the same can be done for a Record version of
> ProtoUser or CRUDify.
>
> I've also changed the mechanism for field definition in ProtoUser such that
> fields can be over-ridden in subclasses of ProtoUser/MegaProtoUser.  For
> example:
>
>   override lazy val lastName = new MyLastName(this, 32) {
>     override def displayName = "My cat likes tasty yaks"
>   }
>
> I'm looking forward to review board approval of the changes so I can push
> them into master/master_2.7
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Oct 20, 2010, 8:55:08 AM10/20/10
to lif...@googlegroups.com
On Wed, Oct 20, 2010 at 12:56 AM, adam00 <ada...@autograf.pl> wrote:
Fields in CreatedUpdated trait could be open like the one in ProtoUser
too.

I'll update this trait.
 
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

David Brooks

unread,
Oct 20, 2010, 9:12:52 AM10/20/10
to lif...@googlegroups.com

On 20 Oct 2010, at 13:55, David Pollak wrote:

> On Wed, Oct 20, 2010 at 12:56 AM, adam00 <ada...@autograf.pl> wrote:
>
>> Fields in CreatedUpdated trait could be open like the one in ProtoUser
>> too.
>>
>
> I'll update this trait.

Would it be possible to split it into separate Created, Updated, and CreatedUpdated to conjoin them?

Cheers,
D

David Pollak

unread,
Oct 20, 2010, 9:16:44 AM10/20/10
to lif...@googlegroups.com

If it is, I'll do that.. I don't know if they are mutually dependent.
 

Cheers,
D


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Allyn

unread,
Oct 20, 2010, 11:50:33 AM10/20/10
to Lift
I ran into an issue with ProtoUser this morning that I think could be
considered a bug. It forces you to use primary keys that are the
typical auto incrementing integer. This is fine for simple apps, but
Lift, I believe, is targeted as an extensible system...once you start
sharding your DB's auto incrementing integer keys just don't cut it.
Is there anyway to use ProtoUser as it stands with a primary string
key? If not, can it be added?

On Oct 20, 8:16 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Wed, Oct 20, 2010 at 6:12 AM, David Brooks <davidjamesbro...@gmail.com>wrote:
>
>
>
> > On 20 Oct 2010, at 13:55, David Pollak wrote:
>
> > > On Wed, Oct 20, 2010 at 12:56 AM, adam00 <adam...@autograf.pl> wrote:
>
> > >> Fields in CreatedUpdated trait could be open like the one in ProtoUser
> > >> too.
>
> > > I'll update this trait.
>
> > Would it be possible to split it into separate Created, Updated, and
> > CreatedUpdated to conjoin them?
>
> If it is, I'll do that.. I don't know if they are mutually dependent.
>
>
>
> > Cheers,
> > D
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@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

David Pollak

unread,
Oct 20, 2010, 11:55:55 AM10/20/10
to lif...@googlegroups.com
On Wed, Oct 20, 2010 at 8:50 AM, Allyn <allyn...@gmail.com> wrote:
I ran into an issue with ProtoUser this morning that I think could be
considered a bug. It forces you to use primary keys that are the
typical auto incrementing integer.

This is not a bug.  This is how ProtoUser is designed.  ProtoUser is not meant to be all things to all people, but instead a starting point for your application.
 
This is fine for simple apps, but
Lift, I believe, is targeted as an extensible system...once you start
sharding your DB's auto incrementing integer keys just don't cut it.
Is there anyway to use ProtoUser as it stands with a primary string
key?

No.
 
If not, can it be added?

If you need such functionality, I'd suggest taking the existing ProtoUser code, copying it into your app (it's Apache 2 licensed, so this is okay as long as you retain the copyright notice), and then changing it up to suite your needs.  Given that the logic behind MegaProtoUser is separate from the persistence layer in the branch that this email refers to, your job should be much easier.
 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

Brian KimJohnson

unread,
Oct 20, 2010, 4:03:21 PM10/20/10
to Lift
This is great - when can we expect it to be in master? I don't know
the normal timeline on these sorts of things.

I was writing my own Record CRUD for use with the new Record-Squeryl
so this is very timely.

On Oct 20, 11:55 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> > <liftweb%2Bunsu...@googlegroups.com<liftweb%252Bunsubscribe@googlegroup s.com>>

David Pollak

unread,
Oct 20, 2010, 6:09:37 PM10/20/10
to lif...@googlegroups.com
On Wed, Oct 20, 2010 at 1:03 PM, Brian KimJohnson <brianki...@gmail.com> wrote:
This is great - when can we expect it to be in master?  I don't know
the normal timeline on these sorts of things.

It depends on how long it takes other committers to review the changes.  I'd suggest that if you pull the dpp_issue_684 branch, build and test against it, it will help the other committers make a decision that it's okay.
 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

Naftoli Gugenheim

unread,
Oct 20, 2010, 7:53:54 PM10/20/10
to liftweb
Could you give an example usage of an customizable CreatedUpdated?

Naftoli Gugenheim

unread,
Oct 20, 2010, 7:54:46 PM10/20/10
to liftweb
Oh wow---this uses the "new" lazy val field feature?


--
Reply all
Reply to author
Forward
0 new messages