Artemix
Artemix

Reputation: 8655

Integrating Java and Flex

I dont know if this question belongs to this site but, I have the following doubt, these last days I saw a lot of job proposals, that consist in Java and Flex, I dont know a thing about Java, but I wonder, is Java used for backend only? (replacing PHP i.e), or it could be used in combination with Flex in the client side?

Thanks.

Upvotes: 2

Views: 169

Answers (1)

Ravi Wallau
Ravi Wallau

Reputation: 10493

We have created a fairly large application that uses Java in the server side (with most of the complicated business logic, database handling, etc...) and the client side is written in Flex.

The client side (Flex part) of the application is for presentation-only and we hardly try to keep all the business logic on the server (Java) side. Some of the reasons are:

  • Knowledge - where I work we are more Java developers more than Flex developers, and Java is something we handle and know better. It is faster and more secure for us to write something in Java than in Flex;
  • Security - keeping your business logic (and things as security, etc...) on the Java side of things will prevent someone from replacing your Flex client with some custom, malicious code and gaining access to your system when they are not supposed to.

To handle the communication between the server and the client, we use Blaze DS. It is not perfect but it is pretty good, and you can customize it to fit your needs. We have customized it so that it would accept enums, and so that we would automatically evaluate if a user was logged-in or not before invoking a Flex service on the Java side.

With Blaze DS, you can make a Java method call from the Flex side (in rough terms). Blaze DS will find the appropriate service handler for the method call you are making, and will make any data type conversions as required. Some configuration is required but once you get past the basics, it is pretty easy.

Upvotes: 2

Related Questions