iDempiere follows specific coding conventions and best practices to maintain code quality and consistency. Before contributing code, please review these standards.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/idempiere/idempiere/llms.txt
Use this file to discover all available pages before exploring further.
Essential Resources
Contributing to Trunk
Comprehensive guide on coding conventions, guidelines, and benchmarks
Fork and Branch Workflow
Detailed explanation of the Git workflow for contributions
Before integrating any code change, please read the Contributing to iDempiere’s core guide to know more about coding conventions, guidelines and benchmarks.
Commit Message Format
All commits must follow the iDempiere standard commit message format:Examples
The ticket number should correspond to a JIRA issue at https://idempiere.atlassian.net
Java Code Standards
iDempiere is primarily written in Java. Follow these conventions:File Headers
All Java files should include the standard iDempiere license header:Package Structure
iDempiere follows a logical package structure:org.compiere.model- Model classes (persistent objects)org.compiere.process- Business processesorg.compiere.util- Utility classesorg.adempiere.webui- Web UI componentsorg.idempiere.test- Test cases
Naming Conventions
Classes
Classes
- Use PascalCase for class names
- Model classes start with
M(e.g.,MOrder,MInvoice) - Process classes end with
Process(e.g.,GenerateInvoiceProcess) - Test classes end with
Test(e.g.,SalesOrderTest)
Methods
Methods
- Use camelCase for method names
- Use descriptive names that indicate what the method does
- Boolean methods should start with
is,has, orcan
Variables
Variables
- Use camelCase for variable names
- Constants should be in UPPER_CASE with underscores
- Use meaningful names that describe the variable’s purpose
Database Columns
Database Columns
- Use database column naming conventions
- Prefix with table abbreviation (e.g.,
C_Order_ID,M_Product_ID)
Code Quality Guidelines
General Principles
Write Clean Code
- Keep methods short and focused
- Use meaningful variable and method names
- Avoid deep nesting
- Follow DRY (Don’t Repeat Yourself) principle
Document Your Code
- Add Javadoc comments for public methods and classes
- Explain complex algorithms
- Document assumptions and limitations
Handle Errors Properly
- Use appropriate exception handling
- Log errors with meaningful messages
- Don’t swallow exceptions silently
Optimize Performance
- Minimize database queries
- Use appropriate data structures
- Cache when appropriate
- Profile before optimizing
Database Best Practices
- Use prepared statements to prevent SQL injection
- Always close database connections properly
- Use transactions appropriately
- Minimize the number of database round trips
- Use connection pooling
UI Development
- Follow the existing UI patterns and conventions
- Ensure accessibility
- Test in different browsers
- Support responsive design principles
Testing Requirements
See the Testing Guide for detailed information about writing and running tests.
Test Coverage
- Write unit tests for new functionality
- Ensure existing tests pass before submitting PR
- Add integration tests for complex features
- Test edge cases and error conditions
Test Data
- Use Garden World data for testing when possible
- Test on test sites before submitting
- Ensure tests are repeatable and deterministic
Code Review Process
All code contributions go through a review process:Automated Checks
Your pull request will be automatically checked for:
- Build success
- Test passage
- Code style compliance
Peer Review
Core contributors will review your code for:
- Code quality and standards compliance
- Functionality and correctness
- Performance implications
- Security concerns
Address Feedback
Respond to review comments and make requested changes:
- Push additional commits to your branch
- Explain your approach if needed
- Ask questions if feedback is unclear
Plugin Development Standards
If you’re developing plugins, refer to:Plugin Best Practices
- Keep plugins focused on specific functionality
- Document plugin configuration and usage
- Provide installation instructions
- Maintain compatibility with iDempiere versions
- Follow the same coding standards as core
License and Copyright
iDempiere is licensed under the GNU General Public License (GPL) version 2.Getting Help
If you have questions about code standards:- Ask in Mattermost
- Post in the forums
- Review the wiki documentation
- Look at existing code for examples
Additional Resources
Contributing Guide
Learn the contribution workflow
Testing Guide
Learn about testing in iDempiere
Wiki
Browse comprehensive documentation
GitHub
View the source code