Tuesday, November 27, 2007

FOSS.IN/2007 is coming up !

(This post's target audience are readers of Python, Zope & Plone
planets.)

This year's FOSS.IN/2007 is coming up next month from December 4th to
8th at National Science Symposium Centre, Indian Institute of Science,
Bangalore, India. FOSS.IN is one of the world's largest FOSS events, held annually in India.
The event's main focus is on development and contributions to FOSS from India.
So, most of the talks are related to FOSS contributions. I also will be presenting a
talk about contributing to Zope project. Well, my original talk I submitted was
a general Python talk, which got rejected, so I also ended up with a
talk like this.

There is another talk related to Zope and Plone by Sreekanth S.R.

During the event, BangPypers will be conducting some BOF sessions. We
welcome all Python programmers to BangPypers BOF sessions.

Me & Nikhil N (last year GSoC student who worked on Python 2.5 porting
of Zope 3) planing to work on some Zope projects at hack center. Any
one intereted in Zope are welcome :)

BTW, this is for the first time I am going to meet Nikhil in person.
It was a nice exprience working with him during GSoC project. He is
also from my native place, Kerala. So, most of our discussions were in
our native language, Malayalam.

Saturday, November 24, 2007

Adapter pattern vs ZCA adapter

This is a section I added to ZCA book recently. I am not a pattern guru,
so please correct me if anthing is not correct or required more explanation.
Thanks !



Adapter pattern
~~~~~~~~~~~~~~~

The adapter concept in Zope Component Architecture and the classic
`adapter pattern` as described in Design Patterns book are very
similar. But the intent of ZCA adapter usage is more wider than the
`adapter pattern` itself. The intent of `adapter pattern` is to
convert the interface of a class into another interface clients
expect. This allows classes work together that couldn't otherwise
because of incompatible interfaces. But in the `motivation` section
of Design Patterns book, GoF says: "Often the adapter is responsible
for functionality the adapted class doesn't provide". ZCA adapter has
more focus on adding functionalities than creating a new interface for
an adapted object (adaptee). ZCA adapter lets adapter classes extend
functionality by adding methods. (It would be interesting to note
that `Adapter` was known as `Feature` in earlier stage of ZCA
design. ) [#feature]_

The above paragraph has a quote from Gang of Four book, it ends like
this: " ...adapted class doesn't provide". But in the next sentence I
used "adapted object" instead of "adapted class", because GoF
describes about two variants of adapters based on implementations.
The first one is called `class adapter` and the other one is called
`object adapter`. A class adapter uses multiple inheritance to adapt
one interface to another, on the other hand an object adapter relies
on object composition. ZCA adapter is following object adapter
pattern, which use delegation as a mechanism for composition. GoF's
second principle of object-oriented design goes like this: "Favor
object composition over class inheritance". For more details about
this subject please read Design Patterns book.

The major attraction of ZCA adapter are the explicit interface for
components and the component registry. ZCA adapter components are
registered in component registry and looked up by client objects using
interface and name when required.

.. [#feature] Thread discussing renaming of `Feature` to `Adapter`:
http://mail.zope.org/pipermail/zope3-dev/2001-December/000008.html

Wednesday, November 21, 2007

ZCA book translations - bzr - Launchpad - user group

Lorenzo Gil Sanchez (Gazpacho fame) is working on a Spanish
translation of ZCA book (PDF). It was a surprise for me to see a new bzr
branch at Launchpad for Spanish translation. Kent Tenney was also
excited, keep up the good work, Lorenzo ! I have published his
translation in my site (PDF). If anyone want to help him with
this translation or start a new translation to another language, you can
simply create bzr branch there and start working it.

Since I am involved in Zope 3, I become a heavy svn user. Now, after
I started using bzr for this project I realized the power of bzr (This
may be applicable to other DVCS). Currently we have three active
branches, the feature I like very much is merging from other branches
(Oh ! it's really cool). Thanks to Canonical for providing such a nice
hosting for bzr. After all Launchpad is a ZCA based application, then
how it won't be cool ? ;)

Since I published this work in last month, there was almost 5000 hits
for ZCA book. Also I got good comments and feedbacks in my journal
and through mail. It looks like people are also interested in
translating this work to other languages. To coordinate all these
efforts, I have created a google group. So, if you are interested to
help me in any way to finish this work, you can join me there.
Well, this is not a general discussion list for ZCA itself, you can
use zope3-users list for that.

Wednesday, November 14, 2007

ZCA book project at Launchpad

I got good comments for my last post about ZCA book (PDF).
Thanks to all those who commented in my journal.

Few days back, Kent Tenney suggested to host this project in a public repository,
so that, others can also contribute. Then, he himself setup a Lauchpad
project for the book
. Details about how to contribute is given in
the README.txt file there. I hope you will create a branch there :)

Kent Tenney also created a nice logo:

Wednesday, November 7, 2007

At last Zope 3 releases coming to an end !

Few days back Stephan Richter released Zope 3.4 second beta release.
The Zope 3.4 release may be the last release of Zope 3 release
as a single package. There is still a minor chance for a 3.5 release.
Anyway, Zope 3 as a single package is coming to an end. I won't be
surprised if the term "Zope 3" itself vanish in the future.

This is a good thing for the future of Zope project & community. As I
implied in one of my last post, Zope is becoming more "Pythonic".
Well, I am not going to describe "What is Pythonic" :) . You know,
Zope is even dropping the server business ! (Zope 3 used Twisted web
server as the default server for a long time). We also retired
zope3-dev list last month .

For those who using Zope 3.3 or earlier versions, Zope 3.4 is a chance
(may be last) for migrating to egg and buildout based system for
development and deployment.

Now you might wonder, "Where is Zope going ?" . This is a very
difficult question for me to answer, so, I refrain from trying it :)
Here I am just giving two pointers: Grok, Repoze.

However, I believe Zope 3 will live for a long time through the
numerous packages derived from it.

Update:I forgot another pointer: zopeproject

Thursday, November 1, 2007

Firefox bookmark for ZCA reference lookup !

Last week, Kent Tenney send me a cool Firefox trick for ZCA reference lookup.
His suggestions helped me to improve English style and usage in that book (Thanks Kent!).
With this cool trick you can go to a reference section just typing 'zca ' follwed by the word all in small letters.

I am quoting his message as such:


I just created a Firefox bookmark with the following properties:

Name: Zope Component Architecture
Location: http://www.muthukadan.net/docs/zca.html#%s
Keywork: zca

Now, when I type in the Firefox location bar:
zca getadapter

I'm taken to the reference for that method.

Handy!


Kent, I reused this nice trick for another purpose also :)
To render reST page as HTML you can create a bookmark like this:


Name: reST to HTML
Location: http://api.rst2a.com/1.0/rst2/html?uri=%s&style=zope
Keywork: r2h


Thanks to rst2a.com team ! Now whenever I see a reST file online, I just prefix it with 'rst ',
this gives me a nice HTML page !

Text below is for my Kerala friends:

എല്ലാ കേരളീയര്‍ക്കും എന്റെ കേരളപ്പിറവി ആശംസകള്‍ !