notes-computer-programming-looselyCoupledArchitecture

Examples of software architectures (and some architecture patterns) that are thought to be modular, and related notes and principals:

Middleware with environment pattern

Example: wsgi

As summarized by ericmoritz on reddit:

"

  1. Some hypothetical application wide auth&auth module from auth import authorized, BasicAuthMiddleware? from myflaskapp import blog_app from mybottleapp import events_app from from frontcontroller import Front

class AuthenticateMiddleware?(object): def __init__(self, app): self.app = app

    def __call__(self, environ, start_response):
        if authorized(environ['REMOTE_USER'], environ['PATH_INFO']):
            return self.app(environ, start_response
        else:
            start_response("401 Unauthorized", [])
            return "Permission Denied"
  1. Here's some hypothetical front controller application = Front({"/blog": blog_app, "/events": events_app}) application = BasicAuthMiddleware?(AuthenticationMiddleware?(application))

This approach is the WSGI way™. It makes it so that you can integrate any WSGI app regardless of what the framework is. Unfortunately many micro/mega frameworks make it hard to do this.

"

Component architectures

Principal: tight coupling on the lower level assists pluggability at a higher level

component architecture, event hooks, zca

Paul Everitt's summary of Chris McDonough on pluggable apps: "A plugin-story’s success is directly related to the ruthlessness of the decisions and opinions being made. The more you define the surface area by making the choices, the more viable the plug point. Over-generalization is the enemy."

REST

unix pipes

files

Compositing

Compositing is more modular than inheritance

Other notes

something i dont understand yet; what makes wsgi, rest, so much better than other things only slightly more complex? it seems like it is more than just a power law