Menu

Developer_area

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....

1. Setting up a Mars Simulation Project Development Environment

a. Command Line

[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.

b. Eclipse

Setting up a MSP development environment with Eclipse describes how to check out, build, and run the Mars Simulation Project with the Eclipse SDK.

2. Miscellaneous

a. Using Logging in MSP

- 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);
}

b. Persist data easily

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();
   }

Related

Wiki: Getting_Started_with_MSP
Wiki: Setting_up_a_MSP_development_environment_with_the_command_line
Wiki: Space.menu
Wiki: Wiki

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.