Using Object::Pad to upgrade LinkedList::Single: Cleaning up and extending an existing package.

By Steven Lembark

Elevator Pitch

O::P provides a clean, flexible, declarative, performant platform for OOP. The original LinkedList::Single used a bless ref-to-scalar, O::P allows breaking the code into roles, limiting access to the internals, simple, flexible classes, and an overall saner structure.

Description

LinkedList::Single works, but the internals are a bit messy in having to anchor the list with a separate inside-out root structure. Using Object::Pad I’m able to use the same, simple scalar but avoid all of the inside-out mess to manage it. Breaking the functionality into roles simplifies managing and extending it all, separate classes based on the roles allow for lists, cursors, and transient objects to simplify transferring and buffering content (e.g., for sorts). The result is equally performant (or better) and simpler to use with the separation of lists, cursors, and transient objects. This talk looks at how Object::Pad was used to refactor the core functionality, how the roles split up functionality, and how simple the classes are once the code is pushed into roles.

Notes

The is partly a followup to last year’s O::P talk, showing how to actually apply it.