JVM and .NET at the same time possible?

JVM and .NET at the same time possible?

  
Hi, we have code developed that run on .NET using C# and code developed to run on the JVM using Java. Can we run both at the same time in the same Outsystems instance?
Hi Daniel,

It depends a lot on what you're trying to acheive and on the environment.

Integration Studio provides an easy way for you to integrate your code libraries by creating an Extension that will consume .dll (.Net) or .jar (Java) files. There's also possible to call Java programs on a .Net extension, but you'll need permissions to do that on the machine. 

This cross communication might not be easy to archeive and unefficient if you're not careful. Please notice that these methods will be called on the request context, meaning that in the worst case you'll be starting Java from .Net on every request. 

best regards,

Hélio
What I'm trying to acheive is have people that are confortable developing on .NET to contribute code that runs on .NET and people that are confortable developing Java to contribute code in Java and be able to run both in the same place where the code is published with the "1-click" publish. 
Hi Daniel,

These extension methods should only be used to create small pieces of code that cannot be done by the product or to reuse existing components/Libraries (e.g. Image manipulation libraries). It shouldn't be a thing you do everyday. If you start having thousands of lines of code in C# you'll lose control of it very soon.

This way I'll also say "no" to the original answer, you should only write code in the platform stack you have, because that's way more easy to do and efficient. 

best regards,
Hélio


Hélio Dolores wrote:
Hi Daniel,

These extension methods should only be used to create small pieces of code that cannot be done by the product or to reuse existing components/Libraries (e.g. Image manipulation libraries). It shouldn't be a thing you do everyday. If you start having thousands of lines of code in C# you'll lose control of it very soon.

This way I'll also say "no" to the original answer, you should only write code in the platform stack you have, because that's way more easy to do and efficient. 

best regards,
Hélio

 
For clarification on your last statement, "you should only write code in the platform stack you have".
 
Does this mean you cannot, or you should not do what the original poster is asking for?
 
Just trying to gain a better understanding of OutSystems regardless of what I should or shouldn't do.
Why do you want to write Java or .NET code with the OutSystems Platform?

The majority of your code should be written in the OutSystems Platform visual language. Only when you _really, really_ need to do something at the low level, you _must_ use the underlying technology of your servers. If you're publishing to a .NET server, you have to use .NET. You can also implement the Java version, but that one will not be used until you're publishing to a Java server.

You can run the platform in .NET or in Java, but not both at the same time.
Hi Michael,

As Ricardo said, for the .Net stack you have to use .Net and for the Java stack, Java.
Any other way you find to make it work is not supported.

best regards,
Hélio





Hi all!

A follow-up question for me is.
Is it possible to have a .Net server and a Java server in the same OTAP (lifetime) street?
Because that would be a reason you should write both code languages.

Kind regards,
Martijn
Good question Martijn, I am interested in knowing that.

By the way, when you mention OTAP, you mean DTAP? (Development, Testing, Acceptance and Production)
I dont recommend you do this, but it is technically possible!

Option 1) Run two instance of outsystems platform, one server .NET the other server JAVA, then you would communicate between the two environments via web service. 

Your web service could be in REST or SOAP!

If you just need to run class libraries and not an entire outsystems application, its more efficent to use apache thrift or google protocol buffers. (again, I dont recommend this type of setup with outsystems platform!)

Option 2) You can also use IKVM to convert JAR to .DLL and run it on the outsystems .NET stack
(You dont need the outsystems java stack)

ikvmc.exe myJavaLibrary.jar

output: myJavaLibrary.dll

You might run into some issues! 
 
yes by OTAP I referred to DTAP (OTAP is Dutch, didn't think that one thru ;) )
@Robert So it's possible to have a development .NET environment and a Java testing environment? But It's not recommended.
Martijn Habraken wrote:
yes by OTAP I referred to DTAP (OTAP is Dutch, didn't think that one thru ;) )
@Robert So it's possible to have a development .NET environment and a Java testing environment? But It's not recommended.
 Martijn, Yes if you know what you are doing it is definately possible!, but its not recommended! the amount of time you have to spend on hiring and managing two resources (.NET developers and JAVA developers) plus infrastructure maintaince, is high! 
Robert is right.

There is nothing in LifeTime preventing you from registering environments from different stacks (.NET/Java) or even databases in the same LifeTime.

This is, however, not a recommended way of doing things. A LifeTime infrastructure is meant to be a development cycle set of environments. They should all have, as much as possible, the same configuration as you'll be developing applications in Dev to be ultimately deployed to production. In this scenario you don't want surprises to appear along the way because you changed the underlying database.

If you're developing for .NET / SQL Server, you don't want all the staging environments to be Java / Oracle. It just doesn't make much sense to have this, as the underlying behaviors of the stack may have subtle but important differences and you want to catch those as early as possible in the development cycle.