This page enables members of the MSP team to share technical knowledge.
So do not be shy, feel free to put content here such as tips, tricks, cool tools, new framework introduction....
[Setting_up_a_MSP_development_environment_with_the_command_line] describes how to check out, build, and run the Mars Simulation Project with the command line.
Setting up a MSP development environment with Eclipse describes how to check out, build, and run the Mars Simulation Project with the Eclipse SDK.
- Use logger instead of system.out.println statement
- Use FINE,FINER,FINEST level for logging in sensitive places, for instance in a loop. To improve performance: do something like:
if (logger.isLoggable(Level.FINEST) { //log at finest level logger.finest("test"); }
- In catch blocks, always join the exception trace in the log, it makes the life easier when debugging: so use
try { some code } catch(Exception e) { logger.log(Level.SEVERE, "some message", e); }
If you need to save data in a database, you might need to use technologies such as JDBC, Hibernate...
Hence, the complexities of those tools are sometime not worth for the needs of persistence.
I found a framework to persist Java beans and manage persistent data easily:
DB40 : http://www.db4o.com
Developer area: http://developer.db4o.com
ObjectContainer db=Db4o.openFile("database.db"); try { Data test1 = new Data("Sebastien",26); //persist test1 object db.set(test1); } finally { db.close(); }
Wiki: Getting_Started_with_MSP
Wiki: Setting_up_a_MSP_development_environment_with_the_command_line
Wiki: Space.menu
Wiki: Wiki