RE: attributes and properties

From: Roman Korchagin <romeok_at_rosvet.com>
Date: Wed Oct 06 2004 - 05:15:49 CEST

PP_AttrProp is a bit strange. It has two separate (and almost
independent) maps - one for attributes and another for properties.

Attributes are really a string key to a string value pair, no questions.

But properties are a bit more involved. They are a map of string into a
pair object, where pair->first() is the string value and pair->second()
is a PP_PropertyType object. Initially pair->second is null, it is
created on demand whenever the property is accessed. I can understand
this, it might be sort of conversion from string into appropriate data
type on demand.

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

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.

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

Cheers,
Roman

-----Original Message-----
From: Martin Sevior [mailto:msevior@physics.unimelb.edu.au]
Sent: Wednesday, October 06, 2004 2:58 PM
To: Roman Korchagin
Cc: abiword-dev@abisource.com
Subject: Re: attributes and properties

On Wed, 2004-10-06 at 10:15, Roman Korchagin wrote:
> Hi,
>
> Can someone please explain the difference between attributes and
> properties in AbiWord source?
>
> I understand how properties are used to represent formatting, but I
> cannot grasp the meaning of separation between attributes and
> properties.
>
> Are properties something like schema or what? If they are schema, why
> PP_PropertyType contains the actual property value?
>

Hi Roman,
         I'm not sure why there is a distinction between the two or
why the original AbiWord developers chose to make the distinction. In
general both are used to encode information about a particular document
structure or piece of the document.

In practice properties are used far more often that attributes.

Both defined via "key:value" pairs.

Within the document model these things are just strings and can be any
set of key-value pairs at all. (lives in src/text/ptbl/xp/*.(h,cpp)

The layout engine interprets the key: value pairs and creates the
document you see from them. (Everything in src/text/fmt/xp/*.(h,cpp) )

Cheers

Martin

> Thanks,
> Roman
>
Received on Wed Oct 6 05:15:19 2004

This archive was generated by hypermail 2.1.8 : Wed Oct 06 2004 - 05:15:19 CEST