[ZDP] Re: Réf. : Re: [ZDP] ZDP-Tools: New ZClasses Book, Part and Chapter

Maik.Röder roeder@berg.net
Fri, 21 Jan 2000 18:26:34 +0100


Hi !

Kamon:
> Can you explain a little bit the reasons why it is better to use the
> approach 1. <Part> + <Chapter> + <Subchapter>  (the previous solution I
> used) than the approach 2. <Chapter> tag + "type" attribute.
> Is it only for searching/cataloging aspects or for other reasons as well ?

For defining the views in each ZClass, for assigning different role behaviour.
Being the Maintainer of a Book or Part of a Book is a higher responsibility
that being the Maintainer of a Chapter.

Tom:
> I still don't see a point in making part, chapter, subchapter, etc...
> 
> What then if we want to have a sub-sub chapter, ...?

Create a Sub-sub chapter ZClass.

I think I have a solution to our problem: You can place Sections in the
Chapters and Subchapters, which will list the Sections.

So, Part, Chapter and Subchapter will be the Controllers and
Sections are the domain objects.
 
> Isn't this :
> 
> <?xml version="1.0"?>
> <ZCL title="THE DEFINITIVE ZOPE CONTENT LIBRARY">
>  <Chapter title="A Web Application Platform" purpose="Introducing Zope
> Technology" type="Part"
> num="I">
>      <Chapter title="Introduction" num="I.1" contributor="Tom Deprez"/>
>      <Chapter title="A Web Application Platform" num="I.2" contributor="Tom
> Deprez"/>
>      <Chapter title="Zope as a Web Application Platform" num="I.3">
>        <Chapter title="Scripting Languages" num="I.3.1" contributor="Tom
> deprez"/>
> 
> the same as :
> 
> <?xml version="1.0"?>
> <ZCL title="THE DEFINITIVE ZOPE CONTENT LIBRARY">
>  <Chapter title="A Web Application Platform" purpose="Introducing Zope
> Technology" type="Chapter"
> num="I">
>      <Chapter title="Introduction" num="I.1" contributor="Tom Deprez"/
> type="Chapter">
>      <Chapter title="A Web Application Platform" num="I.2" contributor="Tom
> Deprez" type="Chapter"/>
>      <Chapter title="Zope as a Web Application Platform" num="I.3">
>        <Chapter title="Scripting Languages" num="I.3.1" contributor="Tom
> deprez"type="Chapter"/>

From an XML point of view both is not the intended usage. We need to have
a structure which is given by the tags, not by the properties !

> Part I
>   Chapter I.1
>   Chapter I.2
>   Chapter I.3
> Part II

Part gives the structure and Chapter is different from Part in
that it can only be contained in a Part. Parts can not be contained
in Chapters.
 
> or
> 
> Chapter I
>   Chapter I.1
>   Chapter I.2
>   Chapter I.3
> Chapter II

Chapter says nothing about the structure when you use it everywhere.

> as in books, Part I and Part II are just Chapters... What change in the
> look of  Part I and Part II will not be appropriate in its chapters?

One example: Chapters use numbers ( I,II,III,IV) and chapters use
numbers (1,2,3,4)

If you just have a problem with the parts, then drop them completely in
the XML file. My design of the ZClasses was a mirror of the XML file
structure, except for not being precise enough to also create Subchapters.
Still, Kamon has had a reason to name the Parts explicitely in the XML
file, and the parts give the structure to all chapters underneath, which
he intended.

> The only difference I see is looking who's maintainer of a Part.
> A search sequence would then be "Search for Part"
> or "Search for Chapter with level 1"
> However this would give the same problems with chapters and (sub, sub
> chapters)
> 
> Then you've a "Search for Chapter"
> or "Search for Chapter with level 2"
> 
> ... "Search for Sub Chapter"
> or "Search for Chapter with level 3"
> 
> ....
> 
> For my opinion, I think the last search is easier to implement!
> 
> You always have to look for type=chapter and as extra you've to assign a level
> 
> In the other way, you've to define different searches per type!!

You have trapped me here. As I said earlier the solution is making sections.
Sections can be placed in Books, Parts, Chapters, SubChapter and SubSubchapters.
This way each of these structure objects are responsible for displaying
the Sections differently.

BTW: If you don't want to create a Section ZClass, we could use the 
DocumentFolder as well. Then we finally have a usage for it, and it is
no more an abstract ZClass.

It's good to have this discussed.

Greetings,

Maik