Slim3

Home

Slim3 is a full-stack MVC framework optimized for Google App Engine/Java.

Our main concept is "Simple" and "Less Is More". "Less is more" means simplicity and clarity lead to good design.

80% of the effects come from 20% of the causes. This is known as The Pareto Principle. We concentrate all our energies into 20% of the causes. Programmers can resolve the other issues without framework constraints.

We want to get rid of complex and bloated features from your applications and our framework. As a result, we will slim down.

Slim3 is an open source framework. The license is The Apache Software License, Version 2.0.

The main characteristics of Slim3 are as follows:

Test-driven development Support           

Test-driven development (TDD) is a software development technique that uses short iterations based on pre-written tests. By focusing on the test first, you must imagine how the functionality will be used by clients. As a result, your application will be easy to use.


TDD Cycle of Slim3 is as follows(red parts are specific to Slim3):
  1. A new code and a new test are created by Slim3 automatically
  2. Modify the test
  3. Run the test and see the result
  4. Modify the code
  5. Run the test and see it succeed
  6. Refactor the code
  7. Run the test and see it succeed
  8. Run the code on your browser and see it succeed without restarting your web application due to HOT reloading
  9. Repeat above sequence from 2 to 8.
Slim3 can create a code and the test automatically, so you can start TDD cycle quickly. It is very important to get quick feedback for TDD. Slim3 also offers testing framework for controller, service and model, so you can test your codes easily.


HOT reloading

Slim3 supports HOT reloading. HOT reloading means new version of a class is automatically reloaded on the fly. Due to HOT reloading, when you change the code, you can see the changed result on your browser without restarting web application. The quick feedback is essence of TDD.


Type safe query

Slim3 supports a type-safe query as follows:

EmployeeMeta e = new EmployeeMeta();
List<Employee> list = Datastore.query(e)
    .filter(e.job.equal("ANALYST"), e.salary.greaterThan(5000))
    .sort(e.name.asc)
    .asList();

A meta data of a model like EmployeeMeta is created by Annotation Processing Tool automatically.

An equivalent JDO query is as follows:
PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Employee.class);
query.setFilter("job == \"ANALYST\") && salary > 5000");
query.setOrdering("name asc");
List<Employee> list = (List<Employee>) query.execute();
query.closeAll();
pm.close();


If you use a query based on string, a compiler can not report an error when refactoring the property name.
If you use a type-safe query, when you rename "salary" property, a compiler will tell you "salary" no longer exists, because the meta data of the model is recreated by Annotation Processing Tool when refactoring.

Refactoring is the essence of TDD. Type safe query will help you when you refactor your model.