Why do I like simple object system? Object::Simple story.

Do you like simple object system or lerge object system? I like simple object system.

In old days, I believed Perl would need complete object system, which has meta object protocol and class syntax.
Many perl programmers sought a good way to write object oriented programing.

A famouse lerge object system is Moose.
This module has many features, for example,
has, extends, with, is, isa, corce, dose, required, traits, builder, BUILD, DEMOLISH, etc.

A famouse simple object system is Mojo::Base.
This module is a part of Mojolicious.
Mojo::Base only has "has" method and a option to set default attribute value.

Do you know Mojo::Base was a little more complex at first?
Gradually, Mojo::Base removed the features except only really needed ones.

Mojolicious source codes is very clean. Mojolicious only use single inheritance and delegation.
Simple object system and single inheritance produce very clean codes.

I was surprised because I had believed Perl would need complete object system to produce good codes.

In the day, I started to create Object::Simple module. This module had been more complex. But I saw the good design in Mojo::Base and Mojolicious.
I decided that Object::Simple would become the port of Mojo::Base.

Currently, Mojolicious team don't recommend to create the clone of parts of Mojolicious.
If you need to port the parts of Mojolicious, you should get permission from Mojolicious team.

I use Object::Simple in GitPrep project, Validator::Custom module, and DBIx::Custom module.



Just curious: how does Object::Simple compare to Moo ("Minimalist Object Orientation") that has Moose compatibility?

Leave a comment

About Yuki Kimoto

user-pic I am Yuki Kimoto, Japanese Perl programmer. I create tutorial site in Japanese, and I create Perl modules and Perl Applications.