I'm an artist, editor, website maker and consultant.

Web Component Development with Zope 3 Ch 2

Filed Under:

Notes from reading

Components[+] overview

What's a component?

  • Some actor that performs part of a "complex action"
  • In Zope, some kind of object  that clearly defines what it provides and what it expects from other objects
  • That two-way proviso is called a contract
  • In Zope, contracts are expressed via interfaces
  • Therefore, a component is an object that has an interface
i.e. every object must have an interface to be a component

What kind of components are there?

  • Three categories usually: Model, View and Controller
  • Model = content
  • View = presentation
  • Controller = "processes data in order to change the model or the view"

How Zope Component Architecture handles MVC:

  • Adapters[+] = implement controllers and views
  • Utilities[+] = "fulfilling a certain task without the context of another component
  • what about the Model? = content components = see below

Interfaces[+]

  • Describe what a component is meant to do, but don't describe how it does it
  • Not core Python, so you have to import from zope package zope.interface

Content Components

Content components = Python classes

Sounds like maybe a confusing naming convention, since apparently content components "do not have to implement a special interface." Does that mean they don't have to declare any interface?

Assume this is the role of adapters...? To handle interfaces for components that may not declare them themselves...?