I don't understand one sentence in section 4.5

0 बार देखा गया
नहीं पढ़े गए पहले मैसेज पर जाएं

Lorenzo Gil Sanchez

नहीं पढ़ी गई,
22 नव॰ 2007, 8:47:22 am22/11/07
ईमेल पाने वाला zcadoc
Hi guys,

While translating chapter 4 I got to the last paragraph of section 4.5
and here I found a sentence which I can't understand, probably because
of grammar issues. This is the sentence:

"ZCA adapter has more focus on adding functionalities than new
interface for existing functionality of adaptee."

Baiju, can you rewrite it somehow?

Lorenzo

Kent Tenney

नहीं पढ़ी गई,
22 नव॰ 2007, 10:51:35 am22/11/07
ईमेल पाने वाला zca...@googlegroups.com
Lorenzo,

I'm doing a bit of editing today, I'll look at cleaning up that section today.

Thanks,
Kent

On Nov 22, 2007 7:47 AM, Lorenzo Gil Sanchez

Baiju M

नहीं पढ़ी गई,
22 नव॰ 2007, 12:23:31 pm22/11/07
ईमेल पाने वाला zca...@googlegroups.com
On Nov 22, 2007 7:17 PM, Lorenzo Gil Sanchez

The previous sentence has a typo which changed complete meaning
of that sentence (I blame Emacs' M-/ ) . Then the following sentence
become clueless

In the previous sentence, I used 'adpater' instead of 'adapted'
(in the second place), it should be like this:

But in the `Motivation` section, GoF says: "Often the
adapter is responsible for functionality the adapted class doesn't
provide". ZCA adapter has more focus on adding functionalities than


new interface for existing functionality of adaptee.

It looks like, it is still not very clear. I will try to re-write it later.

May be:

ZCA adapter has more focus on adding functionalities than

new interface for existing functionality of adapted class/(object?).

Regards,
Baiju M

Baiju M

नहीं पढ़ी गई,
23 नव॰ 2007, 10:09:25 am23/11/07
ईमेल पाने वाला zca...@googlegroups.com

I re-wrote that section like this, please review:
---------------------------------------------------------------------

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 Degisgn 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

Regards,
Baiju M

Lorenzo Gil Sanchez

नहीं पढ़ी गई,
24 नव॰ 2007, 5:06:53 am24/11/07
ईमेल पाने वाला zcadoc
Congratulations Baiju, now it's crystal clear to a dork like me :-)

Lorenzo

On Nov 23, 4:09 pm, "Baiju M" <baiju.m.m...@gmail.com> wrote:
> On Nov 22, 2007 10:53 PM, Baiju M <baiju.m.m...@gmail.com> wrote:
>
>
>
> > On Nov 22, 2007 7:17 PM, Lorenzo Gil Sanchez
सभी प्रषकों को उत्तर दें
लेखक को उत्तर दें
आगे भेजें
0 नया मैसेज