You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Massimo Lusetti <ml...@gmail.com> on 2012/08/16 19:34:35 UTC

MongoDB modules for next 5.4

Hi all,
 I've done some preliminar work on two modules for integration with MongoDB.

The code should be considered more alpha then ever and takes
inspiration from the Hibernate modules.
I've used a similar (in logical sense) version on a prototype app I'm
working on but no other type of tests has been conducted.

I would be more then happy to listen to your ideas and any kind of feedback.

If there's consensus I will include these into the next 5.4 release
when time will come.

Let me know:

https://github.com/mlusetti/tapestry-mongodb-core
https://github.com/mlusetti/tapestry-mongodb

Cheers
-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 16 Aug 2012 18:43:18 -0300, Lenny Primak <lp...@hope.nyc.ny.us>  
wrote:

> Not sure where, but I bet JSON to entity mappers exist somewhere  
> already. No need to reinvent the wheel here.

+1 to having a tapestry-json-mapper package with an overridable  
implementation using the best existing mapper out there, -1 to write a new  
mapper from scratch.

I do think that Plastic could be used to write very fast object mappers,  
but I don't think we should focus on writing one now.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Not sure where, but I bet JSON to entity mappers exist somewhere already. No need to reinvent the wheel here. 



On Aug 16, 2012, at 3:27 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> I've been thinking of a general-purpose way to convert arbitrary
> Objects into JSONObjects, using naming conventions and annotations.  I
> believe it could also be used to reverse the process.
> 
> It would be nice for a Ajax event handler method to be able to return
> an Entity, or a List<Entity> and have that converted to a JSONObject,
> or a JSONArray of JSONObjects automatically. It would also be nice to
> have a ValueEncoder, or equivalent, be able to convert a JSONObject
> back into an Object, knowing the target type.
> 
> On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
> <th...@gmail.com> wrote:
>> On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <ml...@gmail.com>
>> wrote:
>> 
>>> Hi all,
>> 
>> 
>> Hi!
>> 
>> 
>>> I've done some preliminar work on two modules for integration with
>>> MongoDB.
>> 
>> 
>> Nice! I was thinking of doing that someday too. :)
>> 
>> A couple suggestions:
>> 
>> * Injection of MongoDB database instance using @Inject or some other
>> annotation.
>> * Type coercions from MongoDB object to JSONObject and vice-versa.
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Igor Drobiazko <ig...@gmail.com>.
Before starting this project Massimo asked me about my initial plans for
Mongo support. I'll just contribute to this project.

On Thu, Aug 16, 2012 at 10:46 PM, Christian Riedel
<cr...@googlemail.com>wrote:

> I remember Igor talking about a mongodb integration.. What happened with
> it?
>
> Having support for mongodb is a good thing but I think making morphia the
> default mapper is not the best choice.
> We have here some nice integration with the jackson mapper[1], which is
> not so much hibernate-like and gives much more power over everything (we've
> started with morphia as well). I could open-source the integration with
> jackson in a couple of days just to have some more options.
>
> @Howard: I think these tools would also be sufficient to add the features
> you are talking about.
> Otherwise: reinvent the wheel and write a tapestry-json-mapper...
>
> [1] http://jackson.codehaus.org
> https://github.com/vznet/mongo-jackson-mapper
>
>
> Am 16.08.2012 um 22:27 schrieb Howard Lewis Ship:
>
> > I've been thinking of a general-purpose way to convert arbitrary
> > Objects into JSONObjects, using naming conventions and annotations.  I
> > believe it could also be used to reverse the process.
> >
> > It would be nice for a Ajax event handler method to be able to return
> > an Entity, or a List<Entity> and have that converted to a JSONObject,
> > or a JSONArray of JSONObjects automatically. It would also be nice to
> > have a ValueEncoder, or equivalent, be able to convert a JSONObject
> > back into an Object, knowing the target type.
> >
> > On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
> > <th...@gmail.com> wrote:
> >> On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <mlusetti@gmail.com
> >
> >> wrote:
> >>
> >>> Hi all,
> >>
> >>
> >> Hi!
> >>
> >>
> >>> I've done some preliminar work on two modules for integration with
> >>> MongoDB.
> >>
> >>
> >> Nice! I was thinking of doing that someday too. :)
> >>
> >> A couple suggestions:
> >>
> >> * Injection of MongoDB database instance using @Inject or some other
> >> annotation.
> >> * Type coercions from MongoDB object to JSONObject and vice-versa.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de
http://twitter.com/drobiazko

Re: MongoDB modules for next 5.4

Posted by Massimo Lusetti <ml...@gmail.com>.
On Thu, Aug 23, 2012 at 6:26 PM, Josh Canfield <jo...@gmail.com> wrote:

> Ha, that's what I get for reading an old thread and not finishing it before
> commenting.
>
> I agree, an dependency on Morphia is a bad choice for me as well.

BTW I've also played with Jackson (based) integrations and are pretty
cool, infact my current code base depends on it.
I've also played with plastic and used its features to modify (at
loading) the classes to feet with mongo but this code is under
evaluation on one of my clients.

What is of most interest to me (at least now) is to know how to handle
(gracefully and efficently) the intrinsic value of multi-database
capabilities of mongo in a (tapestry) web environment.

Any hint is welcome here...

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Josh Canfield <jo...@gmail.com>.
Ha, that's what I get for reading an old thread and not finishing it before
commenting.

I agree, an dependency on Morphia is a bad choice for me as well.

On Thu, Aug 16, 2012 at 1:46 PM, Christian Riedel
<cr...@googlemail.com>wrote:

> I remember Igor talking about a mongodb integration.. What happened with
> it?
>
> Having support for mongodb is a good thing but I think making morphia the
> default mapper is not the best choice.
> We have here some nice integration with the jackson mapper[1], which is
> not so much hibernate-like and gives much more power over everything (we've
> started with morphia as well). I could open-source the integration with
> jackson in a couple of days just to have some more options.
>
> @Howard: I think these tools would also be sufficient to add the features
> you are talking about.
> Otherwise: reinvent the wheel and write a tapestry-json-mapper...
>
> [1] http://jackson.codehaus.org
> https://github.com/vznet/mongo-jackson-mapper
>
>
> Am 16.08.2012 um 22:27 schrieb Howard Lewis Ship:
>
> > I've been thinking of a general-purpose way to convert arbitrary
> > Objects into JSONObjects, using naming conventions and annotations.  I
> > believe it could also be used to reverse the process.
> >
> > It would be nice for a Ajax event handler method to be able to return
> > an Entity, or a List<Entity> and have that converted to a JSONObject,
> > or a JSONArray of JSONObjects automatically. It would also be nice to
> > have a ValueEncoder, or equivalent, be able to convert a JSONObject
> > back into an Object, knowing the target type.
> >
> > On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
> > <th...@gmail.com> wrote:
> >> On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <mlusetti@gmail.com
> >
> >> wrote:
> >>
> >>> Hi all,
> >>
> >>
> >> Hi!
> >>
> >>
> >>> I've done some preliminar work on two modules for integration with
> >>> MongoDB.
> >>
> >>
> >> Nice! I was thinking of doing that someday too. :)
> >>
> >> A couple suggestions:
> >>
> >> * Injection of MongoDB database instance using @Inject or some other
> >> annotation.
> >> * Type coercions from MongoDB object to JSONObject and vice-versa.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: MongoDB modules for next 5.4

Posted by Massimo Lusetti <ml...@gmail.com>.
On Thu, Aug 16, 2012 at 10:46 PM, Christian Riedel
<cr...@googlemail.com> wrote:

> Having support for mongodb is a good thing but I think making morphia the default mapper is not the best choice.
> We have here some nice integration with the jackson mapper[1], which is not so much hibernate-like and gives much more power over everything (we've started with morphia as well). I could open-source the integration with jackson in a couple of days just to have some more options.
>
> @Howard: I think these tools would also be sufficient to add the features you are talking about.
> Otherwise: reinvent the wheel and write a tapestry-json-mapper...

Your path has been my first pass and I've made some experiment
applying the same technologies used in tapestry "reserved" packages
(pages, components, mixins...) to the "mongodb-entities" package just
to tech each entity how to work with mongo and pojo, that path is
definitely what sounds better for the future. I just wanted to have
something out to spread the sparks of discussion.

Morphia is simply a fact of quickness in the implementation, in fact
I've tested Jongo (you can see the code in one of the module) which
use Jackson under the hood and that has given me the idea illustrated
above

BTW in the above experiment there was some sort of a very limited
JSON(Object|Array) to Entity coercion.

Any contribution is welcome
-- 
Massimo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Christian Riedel <cr...@googlemail.com>.
I remember Igor talking about a mongodb integration.. What happened with it?

Having support for mongodb is a good thing but I think making morphia the default mapper is not the best choice.
We have here some nice integration with the jackson mapper[1], which is not so much hibernate-like and gives much more power over everything (we've started with morphia as well). I could open-source the integration with jackson in a couple of days just to have some more options.

@Howard: I think these tools would also be sufficient to add the features you are talking about.
Otherwise: reinvent the wheel and write a tapestry-json-mapper...

[1] http://jackson.codehaus.org
https://github.com/vznet/mongo-jackson-mapper


Am 16.08.2012 um 22:27 schrieb Howard Lewis Ship:

> I've been thinking of a general-purpose way to convert arbitrary
> Objects into JSONObjects, using naming conventions and annotations.  I
> believe it could also be used to reverse the process.
> 
> It would be nice for a Ajax event handler method to be able to return
> an Entity, or a List<Entity> and have that converted to a JSONObject,
> or a JSONArray of JSONObjects automatically. It would also be nice to
> have a ValueEncoder, or equivalent, be able to convert a JSONObject
> back into an Object, knowing the target type.
> 
> On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
> <th...@gmail.com> wrote:
>> On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <ml...@gmail.com>
>> wrote:
>> 
>>> Hi all,
>> 
>> 
>> Hi!
>> 
>> 
>>> I've done some preliminar work on two modules for integration with
>>> MongoDB.
>> 
>> 
>> Nice! I was thinking of doing that someday too. :)
>> 
>> A couple suggestions:
>> 
>> * Injection of MongoDB database instance using @Inject or some other
>> annotation.
>> * Type coercions from MongoDB object to JSONObject and vice-versa.
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Josh Canfield <jo...@gmail.com>.
Have you considered using Jackson and ObjectMapper? there doesn't seem to
be a really good reason to implement this again.

There is a plugin for jackson that reads/writes BSON objects, I'm sure an
adapter could be created to write Tapestry JSON.

What would be really nice is if Tapestry JSON was interface based and not
concrete implementations so that I didn't have to convert between different
JSON representations...

Wishing I had more time to work on this,
Josh


On Thu, Aug 16, 2012 at 1:27 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> I've been thinking of a general-purpose way to convert arbitrary
> Objects into JSONObjects, using naming conventions and annotations.  I
> believe it could also be used to reverse the process.
>
> It would be nice for a Ajax event handler method to be able to return
> an Entity, or a List<Entity> and have that converted to a JSONObject,
> or a JSONArray of JSONObjects automatically. It would also be nice to
> have a ValueEncoder, or equivalent, be able to convert a JSONObject
> back into an Object, knowing the target type.
>
> On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
> <th...@gmail.com> wrote:
> > On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <ml...@gmail.com>
> > wrote:
> >
> >> Hi all,
> >
> >
> > Hi!
> >
> >
> >>  I've done some preliminar work on two modules for integration with
> >> MongoDB.
> >
> >
> > Nice! I was thinking of doing that someday too. :)
> >
> > A couple suggestions:
> >
> > * Injection of MongoDB database instance using @Inject or some other
> > annotation.
> > * Type coercions from MongoDB object to JSONObject and vice-versa.
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: MongoDB modules for next 5.4

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've been thinking of a general-purpose way to convert arbitrary
Objects into JSONObjects, using naming conventions and annotations.  I
believe it could also be used to reverse the process.

It would be nice for a Ajax event handler method to be able to return
an Entity, or a List<Entity> and have that converted to a JSONObject,
or a JSONArray of JSONObjects automatically. It would also be nice to
have a ValueEncoder, or equivalent, be able to convert a JSONObject
back into an Object, knowing the target type.

On Thu, Aug 16, 2012 at 11:47 AM, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <ml...@gmail.com>
> wrote:
>
>> Hi all,
>
>
> Hi!
>
>
>>  I've done some preliminar work on two modules for integration with
>> MongoDB.
>
>
> Nice! I was thinking of doing that someday too. :)
>
> A couple suggestions:
>
> * Injection of MongoDB database instance using @Inject or some other
> annotation.
> * Type coercions from MongoDB object to JSONObject and vice-versa.
>
> --
> Thiago H. de Paula Figueiredo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: MongoDB modules for next 5.4

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 16 Aug 2012 14:34:35 -0300, Massimo Lusetti <ml...@gmail.com>  
wrote:

> Hi all,

Hi!

>  I've done some preliminar work on two modules for integration with  
> MongoDB.

Nice! I was thinking of doing that someday too. :)

A couple suggestions:

* Injection of MongoDB database instance using @Inject or some other  
annotation.
* Type coercions from MongoDB object to JSONObject and vice-versa.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org