Discussion:
[jifty-devel] Jifty apps talking to each other
Stanislav Sinyagin
2009-10-15 08:31:43 UTC
Permalink
hi,

I've got two Jifty apps (made by myself), and now I need to share some data between them.
Ideally I would see it working as follows:

AppOne opens the access to its data via REST or YAML or XML or whatever over HTTP.

AppTwo (potentially running on a different server) has the sources of AppOne
in its Perl include path. Then it would create the AppOne objects just the same way as it
would create its own objects, and internal Jifty logic would access the objects via the network:

my $apples = new AppOne::ApplesCollection;
while( my $apple = $apples->next() )
{...}

Less ideally, but still OK, is to pass the network access details in the object constructor
arguments. Or maybe a wrapper like this:

my $apples = new Jifty::NetWrapper( application => 'AppOne',
object => 'ApplesCollection' );
while( my $apple = $apples->next() )
{...}



Is there any plan for such functionality? Is there some way to do something already now?
Or I have to end up in coding raw SQL queries to access the other app's data?


cheers,
stan
Jesse Vincent
2009-10-16 17:47:54 UTC
Permalink
Post by Stanislav Sinyagin
Is there any plan for such functionality? Is there some way to do something already now?
Or I have to end up in coding raw SQL queries to access the other app's data?
I thought Sartak was working on a Jifty::Model::Net::Jifty at one point.

Shawn, did that go anywhere?

-jesse
Shawn M Moore
2009-10-16 21:18:33 UTC
Permalink
Post by Jesse Vincent
Post by Stanislav Sinyagin
Is there any plan for such functionality? Is there some way to do something already now?
Or I have to end up in coding raw SQL queries to access the other app's data?
I thought Sartak was working on a Jifty::Model::Net::Jifty at one point.
Shawn, did that go anywhere?
-jesse
It never got that far. I was working on a Net::Jifty refactor that used
real classes. It didn't get far out of the design and prototype phase.
It was a second system. =]

One thing I must warn is that you can't really have two Jifty apps in
the same process, so you're going to have to use the API (or far worse,
the database directly). Net::Jifty should make that less painful than
WWW::Mechanize, I hope!

Shawn

Loading...