RE: attributes and properties

From: Roman Korchagin <romeok_at_rosvet.com>
Date: Wed Oct 06 2004 - 23:53:01 CEST

Thanks Tomas,

Your explanation helps. No way I could have figured that out myself. The
names are quite misleading when PP_Property means "property schema" and
PP_PropertyType means "property value". It could have been better if
they were the other way around :)

By the way, PP_PropertyMap is not used as far as I can see. Only Line,
Color etc classes nested inside PP_PropertyMap are used, but not
PP_PropertyMap itself. The lookup from string into numerical property id
is also not used. The property names seem to be represented as strings
everywhere.

Cheers,
Roman

-----Original Message-----
From: Tomas Frydrych [mailto:tomasfrydrych@yahoo.co.uk]
Sent: Thursday, October 07, 2004 1:53 AM
To: Roman Korchagin
Cc: abiword-dev@abisource.com
Subject: RE: attributes and properties

Hi Roman,

> But why both, attributes and properties? Is it really just an
> oversight remaining from some earlier days?

I do not think the distinction between attrs and props is just an
oversight: it has to do with the structure of the AbiWord xml
document. Attributes represent attributes of xml elements; for
example <p style="Normal"> has an attribute style. The properties, on
the other hand correspond to css-like properties and are stored as a
single attribute: <p props="font-size:12pt;font-face:Arial"> has one
attribute (props) and two properties (font-size, font-face).

While in practices a piece of information could be stored either as
an attribute or property, I think the intention of the founding
fathers was to follow the CSS model closely when it came to
formatting, and that properties are things that strictly define
appearance and could be stored in a style-sheet while attributes are
things that could not be changed by change of style sheet. If that
was in fact the intention, we have somewhat strayed from that
distinction, and some of the current props might have been better as
attributes.

> On top of that, there is a strange PP_Property class which is, in
fact,
> not even used inside PP_AttrProp. It just sometimes can have
> PP_PropertyType that will hold the value.

PP_Property is used to store default values for individual properties
(e.g., if no font-face defined, use 'Times', etc.) PP_AttrProp
represents attributes and properties of a particular xml element in
the document.

> There is also PP_PropertyMap class. Another map? We already have two.

That one is for translating property names internally into numerical
id's to speedup looking up of (default) values when evaluating.

Tomas
Received on Wed Oct 6 23:53:06 2004

This archive was generated by hypermail 2.1.8 : Wed Oct 06 2004 - 23:53:07 CEST