On Tue, Jan 17, 2023 at 7:08 AM Wayne Sherman wrote:
> A REST class should know how to generate a complete and correct JSON
> representation, so there must be a way to distinguish REST properties
> from non-REST. Which properties have been modified is not sufficient.
Rephrasing that last sentence
On Tue, Jan 17, 2023 at 1:23 AM Michael Van Canneyt wrote:
> Yes. The reason is the code generator:
>
> Ideally, every property simply has a unique index specifier.
>
> But when generating classes, the code generator has no way of knowing how
> many properties exist in parent classes, so it must st
On Mon, 16 Jan 2023, Wayne Sherman via fpc-devel wrote:
On Mon, Jan 16, 2023 at 12:16 PM Wayne Sherman wrote:
I need clarification about the auto generated class index
specifiers. Do they always start at 0 in each descendant
class, or are they unique across all descendant classes?
TBaseObj
On Mon, Jan 16, 2023 at 12:16 PM Wayne Sherman wrote:
> I need clarification about the auto generated class index
> specifiers. Do they always start at 0 in each descendant
> class, or are they unique across all descendant classes?
>
> TBaseObject --> TChild --> TGrandChild
>
> TChild = class(TBas
On Sun, Jan 15, 2023 at 9:28 PM Michael Van Canneyt wrote:
> On Sun, 15 Jan 2023, Wayne Sherman wrote:
> > On Sun, Jan 15, 2023 at 9:24 AM Michael Van Canneyt wrote:
> >> On Sat, 14 Jan 2023, Wayne Sherman wrote:
> >>
> >>> I see a couple of problems TBaseObject.SaveToJSON
> >>>
> >>> 1) TBaseObjec
On Sun, 15 Jan 2023, Wayne Sherman wrote:
On Sun, Jan 15, 2023 at 9:24 AM Michael Van Canneyt wrote:
On Sat, 14 Jan 2023, Wayne Sherman wrote:
I see a couple of problems TBaseObject.SaveToJSON
1) TBaseObject.SaveToJSON cannot distinguish properties that are part
of the REST protocol from
On Sun, Jan 15, 2023 at 9:24 AM Michael Van Canneyt wrote:
> On Sat, 14 Jan 2023, Wayne Sherman wrote:
>
> > I see a couple of problems TBaseObject.SaveToJSON
> >
> > 1) TBaseObject.SaveToJSON cannot distinguish properties that are part
> > of the REST protocol from properties that are not part of
On Sat, 14 Jan 2023, Wayne Sherman wrote:
I see a couple of problems TBaseObject.SaveToJSON
1) TBaseObject.SaveToJSON cannot distinguish properties that are part
of the REST protocol from properties that are not part of it. It only
knows that properties which have been modified are part of
I see a couple of problems TBaseObject.SaveToJSON
1) TBaseObject.SaveToJSON cannot distinguish properties that are part
of the REST protocol from properties that are not part of it. It only
knows that properties which have been modified are part of the rest
protocol, but properties which have not
Michael wrote:
> >> Because there may be other published properties that are not part of the
> >> REST protocol. You may for instance decide to add published properties to a
> >> base class that describe where to save the object in a local database.
Wayne wrote:
> > Ok, that clears up that. If I
On Sat, 14 Jan 2023, Wayne Sherman wrote:
On Sat, Jan 14, 2023 at 12:36 PM Michael Van Canneyt wrote:
On Sat, 14 Jan 2023, Wayne Sherman wrote:
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote:
On Sat, 14 Jan 2023, Wayne Sherman wrote:
2) Doesn't each object already have the par
On Sat, Jan 14, 2023 at 12:36 PM Michael Van Canneyt wrote:
> On Sat, 14 Jan 2023, Wayne Sherman wrote:
> > On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote:
> >> On Sat, 14 Jan 2023, Wayne Sherman wrote:
> >>> 2) Doesn't each object already have the parent properties included in
> >>> it
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote:
> On Sat, 14 Jan 2023, Wayne Sherman wrote:
> > 3) Why does MarkPropertyChanged offset the index and
> > IsPropertyModified does not take the offset into account?
>
> They should be the same. I don't remember why I created the two methods
On Sat, 14 Jan 2023, Wayne Sherman wrote:
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote:
On Sat, 14 Jan 2023, Wayne Sherman wrote:
2) Doesn't each object already have the parent properties included in
its own properties by inheritance?
Why this question ?
An object does not k
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote:
> On Sat, 14 Jan 2023, Wayne Sherman wrote:
> > 2) Doesn't each object already have the parent properties included in
> > its own properties by inheritance?
>
> Why this question ?
> An object does not know the property count of the parent
On Sat, 14 Jan 2023, Wayne Sherman wrote:
On Fri, Jan 13, 2023 at 11:48 PM Michael Van Canneyt wrote:
Markpropertychanged is called in the setter of the properties generated by
the code generator: Check all generated units.
Thanks for your explanations, it is getting more clear how modifie
On Fri, Jan 13, 2023 at 11:48 PM Michael Van Canneyt wrote:
> Markpropertychanged is called in the setter of the properties generated by
> the code generator: Check all generated units.
Thanks for your explanations, it is getting more clear how modified
property tracking is being used.
More clari
On Fri, 13 Jan 2023, Wayne Sherman via fpc-devel wrote:
Is there a better way to track changed TBaseObject properties (and get
rid of property index declarations)?
Not to my knowledge. If there had been, I would have used it.
The advantage of the index as opposed to using a custom assigned
On Fri, 13 Jan 2023, Wayne Sherman via fpc-devel wrote:
Some related misunderstandings:
1) When StopRecordPropertyChanges is called it destroys all the
change records (stored in TBits) in which case SaveToJSON saves ALL
the properties even if they were not loaded or modified previously.
Th
On Fri, 13 Jan 2023, Wayne Sherman via fpc-devel wrote:
I am trying to check the googleapiconv "TGoogleRestDescription" object
contents (which is descended from restbase TBaseObject) by using
"SaveToJSON". But it always saves an empty object, even when the
properties have values assigned to
Is there a better way to track changed TBaseObject properties (and get
rid of property index declarations)?
Lazarus knows which properties on a form have been changed from their
default value and only properties which do not match the default are
saved in the lfm file. Can the same thing be used
Some related misunderstandings:
1) When StopRecordPropertyChanges is called it destroys all the
change records (stored in TBits) in which case SaveToJSON saves ALL
the properties even if they were not loaded or modified previously.
2) Nothing in restbase.pp or TBaseObject calls MarkPropertyChange
I am trying to check the googleapiconv "TGoogleRestDescription" object
contents (which is descended from restbase TBaseObject) by using
"SaveToJSON". But it always saves an empty object, even when the
properties have values assigned to them (via LoadFromJSON).
https://gitlab.com/freepascal.org/fp
23 matches
Mail list logo