As Michael says, you integrate using REST between Java and Python if
TurboGears are involved. If you don't have a problem to solve that is
matching a REST based design, you probably shouldn't use TurboGears in the
first place anyway.

/Martin


2015-11-07 6:49 GMT+01:00 Michael Pedersen <[email protected]>:

> Good evening.
>
> This is a super open ended question, so the answer to it is very
> difficult. The sarcastic answers are "yes" and "when you identify the need"
> and "using Python for the parts Python is good at, and Java for the parts
> Java is good at".
>
> The not sarcastic answers, though: Yes, there are are times when you will
> be using TurboGears and interacting with something from the Java world. As
> to when, it will almost never be with code from one language calling code
> from another language directly (if you've got that, you're using Jython,
> and unlikely to be using TurboGears). Instead, you will be dealing with
> well documented interfaces, usually via some socket based protocol (with
> http being the most common, via a REST API). If you're dealing with a REST
> API, then it doesn't matter if you've got Java running the backend. Use the
> requests module (see http://docs.python-requests.org/en/latest/ ), and
> the rest is simply implementation details.
>
> If you're dealing with something else, you're still likely dealing with a
> network connection. On the front end, TG will be responding to HTTP
> requests from users, and getting some data from a backend server that
> happens to be written in Java, using some network protocol. If you're
> lucky, it's a common network connection (http, ftp, some database) and the
> modules to communicate are already written. If you're unlucky, you might
> have to roll your own (in which case, you're likely starting with the
> standard Python sockets module, and I don't envy you).
>
> Outside of that, if you're trying to directly call some Java class from
> your Python code, you're probably using Jython, and I'm not even certain
> that TG2 *can* run on Jython.
>
> Really, when asking this sort of question, we would need more details to
> provide any usable answers. What exactly are you trying to accomplish? What
> are the options we're allowed to provide (for instance, can we recommend a
> rewrite of the other side in Python? Can we recommend not using TG to
> accomplish your goals?)?
>
> I hope this answer helps out a little bit, at least.
>
> On Fri, Nov 6, 2015 at 8:40 PM Robert James Liguori <[email protected]>
> wrote:
>
>> Are there any use cases where TurboGears2 can or should be integrated
>> with Java?  If so when and how?
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/turbogears.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/turbogears.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martin Eliasson
+46 (0) 739 97 87 33
http://asplunden.org

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to