Coding Standard
Coding Standards & Style
Source code of DigiBunaiTM uses following coding style conventions. New Code should be written following it. And feel free to format existing code, if it's not following the style.
Indentation, Braces, Spacing and Comments
TAB character should be used for indentation. Each indentation level TAB has width of 4 spaces.
Use opening brace of class definition, function definition, if, else, try, catch etc. on the same line.
Closing brace should be placed on a separate line.
public ClassNameA(){ // opening brace of class
int a = 11;
public int functionNameB(int x, int y){ // opening brace of function
return (x+y);
} // closing brace of function
} // closing brace of class
Spaces should be present around assignment operator �=�, around binary operators (logical and comparison) and after commas and semicolons (not statement ending semicolons).
Spaces should not be present around arithmetic binary operators, before comma, between a function name and its argument list, inside an empty argument list.
Fabric objFabric = new Fabric(); // spaces around assignment operator
popup.add(txtName, 0, 0, 1, 1); // space after comma
for(int i = 0; I < 10; i++); // space after semicolon (not statement ending)
boolean b = flag || flag2; // space around logical operator
int a = (int)(b*c); // no space around arithmetic * operator
void functionName(int a){ } // no space between function name and its arguments
void function(){ } // no space inside empty argument list
Class and function definitions should contain documentation style comment containing brief summary of class or function.
Inline comments are encouraged and are mandatory for complex logic in code.
/**
* UI window for Fabric Creator
* @author Author1 Name
*/
public class FabricView{
private Button btnSaveAs; // button for Save As New fabric
}
Naming Style
Use Pascal Case (PascalCase) for class names. I.e. class name is made of words with each initial letter capitalized (e.g. Fabric, FabricView, MyNewClassName etc.).
Use Camel Case (camelCase) format for variables and function names. I.e. the first word is in lowercase and other following words are having initial letter capitalized (e.g. windowsStage, getUserPreferences() etc.).
DigiBunai
TM Code Structure Overview
DigiBunaiTM source code is structured into following packages (com.mla.x where x is): artwork, cloth, colour, dictionary, fabric, main, pattern, print, simulator, user, utility, weave, yarn.
- All database interaction libraries and scientific/mathematical computation functions are placed in *Action.java classes (e.g. FabricAction.java, WeaveAction.java etc.).
- All UI related code placed in *View.java classes (e.g. WeaveView.java, ArtworkImportView.java etc.).
- Core object classes along with their getter/setter functions are placed in *.java classes (e.g. Fabric.java, Yarn.java, Cloth.java etc.).
- All JavaFX controls placed on a UI are declared next to each other (in order of their placing).
Code Repository
Code Repository
The code has been uploaded at GitLab, Which is an public project to support issues and provide information about the product and upcoming release activity going on.
Technical Team
Technical Team
- Mr. Satya Vir Singh, Principle Research Scientist,
- Ms. Moumita Poddar, Web Designer,
- Mr. Amit Kumar Singh, Senior Software Developer,
- Mr. Ashish Dochania, Project Coordinator,
- Mr. Ram Yash Rajbhar, Software Tester,
- Mr. Aatif Khan, Software Developer,
- Ms. Poonam Prasad, Software Developer.
Copyright Certificate
Copyright Certificate