Home Layered Programming

Layered Programming

If you've ever used photoshop you're probably familiar with layers. The idea is simple you have one photo and you can layer it on another photo with various levels of color or effects. At the touch of a button you can turn off a layer, duplicate a layer or create a new layer. Each layer functions independently but the final image is viewed as a whole.

Now try to imagine applying this same principal to programming. Any large program is a collection of modules, libraries, ideas and concepts. Like an image the code often has different purposes but the end product is seen as a whole. What if you could layer software code? You could place debugging code on one layer. Turn on the debugging layer and you can see all the debugging code. Turn it off again and it's gone and out of your way.

You could duplicate a layer that contains your graphics infrastructure and play around with the duplicate version without impacting the original. Want to remove a feature that's no longer used? Typically the code for the feature can be scattered across your product but if it was all on one layer you could hide the layer and recompile.

Object oriented programming encourages encapsulation so that all the code for one area is located in one nice little package. But the realities of programming aren't that simple. Other aspects to consider:

Linking layers. Where one layer goes the other layer follows. (You can't have the graphics debug layer without the graphics layer)

Merging layers. Combine two programming layers into a single layer.

Layer folders. For much larger projects you would need the ability to group your layers into larger groups and subsystems.

Has anyone ever seen or heard of a development platform like this?

This post is licensed under CC BY 4.0 by the author.