What are your top 3 best practices in Mendix you wish all your colleagues would comply to?

0
Best practices become crucial when a project becomes complex. Even more so when the number of contributors increase. Having good best practices increase developer productivity, security, maintainability, and flexibility.    What are best practices that are lesser known that you think would make a big impact if the rest of the world would know about?
asked
3 answers
3

Grouping microflows into clear components (ie. units)... Creating properly purposed microflows that have:

 - Singular function to use as a unit and to limit testing variations, keeping testing simple, lower complexity

- Abstracted inputs to decouple microflows and to make components reusable (e,g, using a primitive parameter instead of passing in a specific object) This also makes for easier testing setup.

- Wherever possible saving commits to parent flows. We all know that committing at the end of a transaction is ideal, therefore microflows that can be reused should not have commits, the commits should be left to the parent flow that calls the sub. This includes get-create flows.

 

answered
2
  • Fix those damn warnings. They are not just a nuisance. There are extremely useful warnings highlighting security bugs and flaws in your logic.
  • Keep it simple. Adding more and more logic to a single microflow does not make it easier to maintain, read or test.
  • Testing is not something that happens at the end of a sprint or right before a feature is released; testing is part of refinement, development and right until the deployment.

I agree with all items @Jon listed!

answered
2
  1. Use the pre-made building blocks for basic UI, we don't have to reinvent the wheel every time we build a page. 
  2. Use the {Prefix}_{Entity}_{Action} naming convention and don't make the {Action} names too long without an extra _. It is so hard to read all the things if there is no additional space in it
  3. Naming and renaming variables is important, as it will lead to an easier understanding of the code, so if you are not using the variable of the SUB microflow, just don't show it. 
answered