To java or not to Java thats the question.

"No code, just glory" is/was used by Mendix as payoff for their product. In our experience it's indeed more and more possible to produce complex application with only the functionality offered by the modeler (and mendix appstore components). In the forum, for many technical questions, java(script) related solutions are offered when (in my opinion) an adequate "modeler" solution is also available. So my question is: in what specific cases (best practices) using java(actions) is a good choice? We only use javaactions (next to community commons) for: - performance related issues (complex datamanipulation scripts on large numbers of data) - complex scientific and statistics calculations/analyses - Business intelligence related dataoperations - Filesystem related operations
2 answers

Our best practice: don't use java when you don't NEED it. Logic in Mendix is easier to understand/build than in java-code, or at least: That's the whole reason that Mendix exists.

But in some cases you need to use it. Example: if you want to automatically pickup files from a certain location and do something with those files. There is no microflow activity to pick up files automatically without user interaction, so you need java or something else. Typical this kind of scenarios require java in your project, but we try to stay away from custom java-actions.

In major mendix migrations we experienced a lot of work to change java-actions due to mendix api changes.


I concur with Samet. Apart from that, in my opinion, another feature of modeler, where you can take an image of a microflow/model is really great :). Personally I love that feature.

Hence if you are using a too much of java actions then your actions will be prone to api conflicts and changes. Having said that, still there are some operations( may be a tiny one :) ) where i ll prefer java. Such an example will be fetching first item from the list( when you know that your list will only contain one item)..