Introducing ORMAN Framework

Ahmet Alp Balkan
, on

It was a lonely Valentine’s Day for me this year, so I decided to code a framework to practice my SQL, Java, design patterns and Android skills I gained this year. I came up with the idea that coding a lightweight object relational mapper framework would be exciting! :P Then the hack has began and continued on my spare times. What I was trying to achieve a really small framework so that everyone can use databases in their programs and handle common database usages without writing SQL so that all the Java objects are can be saved to and queried from database.

This is not a new idea if you are familiar with the concept already. This is called Object-Relational Mapping and there are hundreds of ORM tools including multi-million dollars projects use such as Entity Framework and Hibernate. As you might guess, those support almost all kinds of databases you might be familiar with and they are really cutting-edge software technologies.

Read article: Why ORMAN is better than other ORMs for you?


It might seem so but I was not trying to reinvent the wheel.

Features I wanted to imitate from other ORM tools:

However, what I was trying to achieve was different than those enterprise solutions:

Use cases

I started using databases when I was 15 (true story). I didn’t know about foreign keys, indices, and even I was not aware of database normalization (remember normal forms, separating different entities into different tables). I didn’t know about JOINs. I didn’t know one-to-one, one-to-many, many-to-one, many-to-many cardinality relationships.

I learned all those stuff when I was 19 and it was the time that I concluded all databases I have designed for 4 years were bullshit. Developers love writing SQL. But some don’t. Because maintaining physical schema sometimes can be frustrating and erroneous as in my story.

Imagine all you have is bunch of Java classes representing entities. Done. ORMAN handles database normalization, JOINs, foreign keys, indices for you.

Assume you have a small Android (Java) app or game, and you want to use a local database. Your program is 350 kb. If you add Hibernate, It is now 4 MB and it will be fast as much as your grandpa! On the other hand, ORMAN is around 150 KB and operates on your database very efficiently.

To be honest, I write this framework for Android. However it runs on desktop Java SE programs as well.

If you plan to use ORMAN on backend of your service or a mission-critial program, then  you’re doing it wrong. It is simply not designed for that.

Current status

ORMAN is licensed under Apache 2 open source License. The source code and latest build are available on GitHub. There is also a Wiki that I’m trying to document all the details of usage. ORMAN works with SQLite, SQLite on Android and MySQL. As I said before, it is not an enterprise solution and only designed for small usages.

Currently, my two friends contribute helping development of the framework: @0ffffffffh and @berkerpeksag. However, we need contributors to the framework that can write tests (we don’t have LOL), resolve issues and write useful features. We also need users for the framework, especially Android app developers.  It is not difficult to contribute ORMAN source code, it is pretty well documented and easy to understand.

We are not pro coders and this project is really an infant right now even it has over 10,000 lines of code.

Code examples

I won’t give code snippets here. If you spend just a few minutes on Wiki, I’m pretty sure that you’ll get the concept.

Lessons learned

In fact, we haven’t even released a stable version yet. However there are a few things I learned from this project. :)

Now that’s the end of the story for now. You can read more about ORMAN and let us know if you are planning to develop something with it. We’d love to hear from you.

P.S. The word “orman” stands for _”forest” _in Turkish.

If you liked this post, you can follow me on Twitter.