Thursday, January 9, 2003

Aggregation versus Inheritance
EuroPython had an interview with Jim Fulton (I can't determine the date, but I'm guessing some time within the past year), in which he gives a good summary of Zope 3's differences over Zope 2 (I've been looking for such a summary):

Zope 3 moves Zope from an inheritance-based framework to a component-based framework. Complexity is managed by splitting responsabilities among many cooperating components, rather than many cooperating mix-in classes. Components are connected using interfaces, which also provide component specification and documentation.

Some other big ideas:

  • It should be possible to use existing Python objects in Zope with little or no change.
  • Applications can be customized by adding, changing, or removing components.
  • Site configuration is done by site-managers or deployment specialists without modifying code.
  • Many CMF technologies will be part of the core.
  • Acquisition and namespace lookup is wildly more explicit.
I could go on, but I won't.

"Cooperating components instead of cooperating classes" could still be seen as an ambiguous phrase. I think developers who are steeped in component models and aggregation would understand it. But what about those who are used to the static overbearing inheritance model?

I guess it could be summed up as "Zope 2 excepts you (you being an object in the Zope system) to provide it lots of information and functionality all by yourself. Zope 3 looks for people to help you".

In Zope 2, if you got annoyed that a particular didn't implement the obscure little method to display sizing information in the ZMI, there wasn't much you could do about it without monkey patching.

In Zope 3, you write an adapter for that object that implements the ISized interface, register the adapter, and voila! One little object helping another.

By developing services to query for adapters (saying "I've got Frank here, can anyone tell me how tall he is?") instead of expecting behavior directly from an object, new doors to interoperability and speciality open up. Susie pops over and says "Why I can tell you, I've got measuring tape right here! He's 5 feet, 11 inches tall." Of course, Frank can say "I can tell you" and report his tallness himself, but he's a busy man and knowing his height at all times just might not be something he needs to do on a daily basis.

Of course, if Susie can be replaced with a robot or some other machine or person that can perform the same job (measure how tall people are), she can be replaced without bringing down the system. Frank's genetic algorithm can't be replaced (easily), so if he's suddenly unable to report his height correctly, he's useless in this situation without someone to help him adapt.

Hmm.
2:37:38 PM  blips[]    




Some quick Safari Tips and Links
I'm generally liking Apple's new Safari web browser. I think it will actually open up some interesting competition in the Mac OS X browser world, at least between Safari and the Mac OS X native Gecko browser, Chimera. There's already been a lot of talk about Safari, these are just a couple of links and downloads that have stuck out for me:
  • Dave Hyatt's Surfin Safari weblog. Dave is the lead developer of WebCore, the rendering side of Safari. He's responding quickly to a lot of criticism and is already noting significant process in newer builds.
  • Speaking of newer builds, this slashdot journal details how to get at Apple's open source WebCore frameworks and replace Safari's rendering engine with newer builds.
  • Mike Pinkerton responds from a Chimera developer view.
  • Safari Enhancer is a tiny utility application that enables some hidden features of the Sarari beta, namely a handly little Debug menu.

I see some people posting huge lists of all of the other things that Safari should do. Stuff that. I say keep it small, lean, simple, usable.

Now, if Apple really wants to improve my web browsing experience, they'd come up with a way for me to sync my Bookmarks up over iSync/.Mac! I was reading some of the links above this morning before coming in, along with some Zope 3 posts that I just wanted to remember when I came in to work. I was all set to bookmark them, but then realized that I wouldn't have the bookmarks when I came into the office. Urgh. This is happening all too much lately.
12:41:15 PM  blips[]