Ohm – Least Resistance

A few astute readers have noticed that there was a new section, titled Ohm, in the blog header above. They have written in private to ask me, and were shortly included in the private beta testing phase for the project. That phase has now come to an end, as I now reveal the project to begin its open beta testing phase.

ohm-70x70Ohm – Least Resistance is a lightweight PHP 5.2 framework designed to be as simple as possible. You can use Ohm before your morning cup of coffee. If you need to do something clever or unusual, you can read the Ohm source code to find out how you can bend it to your needs: it’s only 2,000 lines, comments included. And Ohm conveys this simplicity to your own code, if you are willing to accept its philosophy:

1. Most frameworks can be extended because there are configuration options for every single piece of behavior. Ohm can be extended because it’s extremely simple.

2. Most frameworks help the programmer write code faster, often pushing the dynamic nature of PHP beyond its safe boundaries. Ohm recognizes that reading code is harder than writing it, and helps the programmer write code that is easy to read later on.

3. Most frameworks try to become repositories for countless pieces of useful but highly specific functionality. Ohm concentrates on being a HTTP/PHP/MySQL framework.

The Ohm framework is open source. In fact, its code is in the public domain, though I appreciate references and/or links back to the project page. What you get by downloading the framework:

  • Class auto-loader : finds your classes based on their name, so you don’t have to use require and include all over the place.
  • Request dispatcher : responds to HTTP requests by loading the appropriate action class and executing its response method.
  • Model-View-Controller : the framework layout follows the MVC pattern and helps your application do so as well.
  • Reusable Layouts : lets you define generic page templates that will be wrapped around the actual template. You can insert JS/CSS into the layout from the content.
  • Simple Forms : a backbone module for creating, processing and drawing HTML forms that you can extend to fit your needs.
  • Database Layer : a dead-simple extension on top of mysqli that lets you have an easier time writing SQL requests and retrieving the data, without having to learn a new query language.

If you have any questions about the framework, you can contact me directly (victor-ohm@nicollet.net). Any comments and feedback are welcome (this is an open beta, after all), either by mail or as comments on this post.

Enjoy!

3 Responses to “Ohm – Least Resistance”


  1. Are you currently using this framework for any projects? Did you make this for personal use and open-source it just to be nice, or do you have bigger plans for it?

    Your explanation in the “There’s already Zend, Symfony and CodeIgniter… Why Ohm ?” section makes me think of my favorite quote: “Simple rules lead to complex behavior. Complex rules lead to stupid behavior.” This quote has guided my approach to design for years, and it seems like you believe in it too. The more special cases you program/design for, the less flexibility you’ll end up having which leads to workarounds and messy code.

    I’ll definitely give Ohm a shot the next time I’m starting a project.

    • Victor Nicollet - August 30, 2010 at 12:03 pm - Reply

      Hi Tyler,

      I am using this framework in a few projects: my personal accounting package (which, for obvious reasons, is not public), the Link Pyramid Scheme http://linksche.me/ (I’ll start advertising it in a short while, when people are back from their holidays) and the Idea Collider http://ideacollider.com/ (I have to remove the Facebook login, as it is somewhat broken, but otherwise the site works). And then, there’s the obligatory secret project that will be revealed “real soon” ;)

      Nice quote you have there. I fully agree with it: reality is a complex thing and you have no control over it to make it simpler. Your code, on the other hand, is under your control: don’t let it become complex.

  1. 1 Tweets that mention Ohm – Least Resistance -- Topsy.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



1150 feed subscribers
(readers who polled a feed this week)