Port of Lift's demo Pocketchangeapp backed by MongoDB

22 views
Skip to first unread message

Alexander Azarov

unread,
Feb 17, 2010, 2:19:25 PM2/17/10
to Lift
I am the author of mongo-scala-driver, it's the library to access
MongoDB, document-oriented database. It is a part of a larger project
which is using Lift, so I've quickly come to the idea to build a
little demo application using mongo-scala-driver and Lift. And finally
I decided to migrate Lift book's Pocketchangeapp demo to MongoDB -- I
think it makes much more sense to compare persistance techniques using
the same app.

I saw two alternatives:
- Use pure scala objects (POSOs) for domain objects. Thus it would be
necessary to provide some equivivalents to the Mapper's methods like
toForm, etc. and the whole ProtoUser stuff
- Create a Mapper replacement on top of mongo-scala-driver

No doubts the second way gives much more in terms of a library and in
the best case this would make it possible to easily migrate existing
Mapper models to MongoDB backend. But my personal goals were much
closer to the first alternative, so it was done this way (however few
methods of MetaMapper moved to the port)

Features:
- Domain objects are more or less clean from persistance stuff, they
more like ordinary Scala classes
- All the functionality has been retained
- I did my best to make the port straightforward -- it will be easier
to compare both branches
- File upload is done using GridFS, MongoDB's API for storing large
binary objects
- BigDecimal support is done using custom data type to mongo-scala-
driver (it's not supported by MongoDB out of the box)

Links:
* http://www.mongodb.org/ MongoDB
* http://github.com/alaz/mongo-scala-driver mongo-scala-driver
* http://www.theliftbook.com/  Pocketchangeapp -- Lift book demo app
* http://github.com/alaz/pocketchangeapp Pocketchangeapp backed by
mongo-scala-driver and MongoDB

Ross Mellgren

unread,
Feb 17, 2010, 8:01:20 PM2/17/10
to lif...@googlegroups.com, Lift
There is a persistence-layer-agnostic layer that provides the form
generation support, field validation logic, and common modelling
called Record. It's fairly similar to Mapper except for the lack of a
SQL backend.

I wrote a driver and record integration for CouchDB which I think is
somewhat similar to MongoDB though I haven't used it myself.

Maybe you could check it out and see if it fits your needs?

-Ross

> --
> 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
> .
>

Alexander Azarov

unread,
Feb 18, 2010, 2:47:53 AM2/18/10
to Lift
Ross,

I am not a fan of ActiveRecord pattern, I prefer to keep domain model
as free from persistance logic as possible. So the experiment with
Pocketchangeapp was to show this approach using mongo-scala-driver.

On 18 фев, 04:01, Ross Mellgren <dri...@gmail.com> wrote:
> There is a persistence-layer-agnostic layer that provides the form  
> generation support, field validation logic, and common modelling  
> called Record. It's fairly similar to Mapper except for the lack of a  
> SQL backend.
>
> I wrote a driver and record integration for CouchDB which I think is  
> somewhat similar to MongoDB though I haven't used it myself.
>
> Maybe you could check it out and see if it fits your needs?
>
> -Ross
>

> > *http://www.theliftbook.com/ Pocketchangeapp -- Lift book demo app
> > *http://github.com/alaz/pocketchangeappPocketchangeapp backed by

Reply all
Reply to author
Forward
0 new messages