On building cross-platform tools
No matter the OS you are using, Linux will be the OS of the server that will run it in production.
Clicking on “Run” in your IDE doesn't means it works.
You need to build it as a jar and verify it is really workingin any environment.
Using Git
Git is a code versioning tool that allows you to save the changes in your code. Uploading it on GitLab to store it in a safe place and allow you to easily share your code.
We are using the LIRMM GitLab to keep track of the code produced in the Advanse team. To do this connect to the LIRMM GitLab using your LDAP credentials. And add you project to the advanse group. You need to notice me to get the permission to post to this group (it is quick).
Create a README.md at the root of your project with details on your project: how it works, how to deploy it, how to run it... It will be parsed in Markdown format to be displayed on the homepage of your project on GitLab
Use library repositories
More easier to download new libraries and more stable.
- Ruby : https://rubygems.org
- Perl : http://www.cpan.org
- Java : http://search.maven.org
for Java
Why using Maven?
- Compiling independent from OS and IDE
- Identical structure for every projects
- Libraries import : easy, fast, stable
- One file to configure the project (pom.xml)
You can deploy your jar on the central repository.
It brings better reusability and visibility to your work. It is appreciated by your jury thesis!
Search maven advanse.lirmm.fr on google: you will find the text-processing library we uploaded there. To use you just need to paste the 5 lines of dependency in your pom.xml:
Add a local dependency:
Then build your maven project: mvn clean package (mvn install pour installer en local)
Creating a maven project
Most IDEs allows you to create a new Maven project with the good file tree.
You also can create one directly using maven (here on Ubuntu):
mvn archetype:create -DgroupId=fr.lirmm.advanse -DartifactId=text-preprocessing
Config and tests
- Always let config samples and examples to test your project
- Always get a SQL script to build your database and make it available (in README or another file on Git)
- Create Unit tests for your classes. It makes the code more stable by tracking broken functions after a change.
Coding guidelines for Java
- Comment your code: for each method, what is it doing? Why? You can produce a javadoc from it
- Never uses jar as executables in the system. Always import them using Maven (not your IDE!) by adding a dependency in the pom.xml
- Then call the classes you want from the imported library
The Advanse web platform architecture
- A API composed of Java servlets. To deploy services
- A webpage in HTML/CSS/AngularJS. To display informations and provide a GUI for the API services
Choosing a technology
- Choosing the technologies for a project is an important part of the process.
- You need to choose a language according to the libraries available on each language. But also try to avoid tools that are not supported anymore and outdated (Glassfish for example)
- And keep in mind that sometimes a script language (like python or ruby) can be more interesting than a compiled language like Java. For little projects it is lighter, easier and faster to use.