[Laszlo-dev] For Review: Change 20071016-hqm-4 Summary: fix for DHTML replication bug
André Bargull
a.bargull at intensis.de
Tue Oct 16 14:12:43 PDT 2007
Changing the signature of "applyConstraint" must be well documented and
you need to maintain backward-compatibility, because this is a public
function, so other folks are using it, too!
[Just as a reminder concerning: "There's only a couple of callers to
applyConstraint right now, ..."]
Henry Minsky wrote:
> That makes sense, to pass the object down instead of the dependencies
> list. There's only a couple of callers to applyConstraint right now,
> but one of them is this one caller in LaszloView that makes it's own
> dependencies list:
>
> function setPosConstraint ( v , f , widthorheight ){
> var d = [ v , widthorheight , this , widthorheight ];
> this.applyConstraint( widthorheight == "width" ? "x" : "y" , f , d );
> }
>
>
> How do think I should handle that? I could make an object and put a
> .dependencies on it and pass that I guess.
>
> On 10/16/07, *P T Withington * <ptw at pobox.com <mailto:ptw at pobox.com>>
> wrote:
>
> In fact, wouldn't it make more sense to move all the logic about
> dependencies inside applyConstraint so it will be handled correctly
> in one place and update all the callers? I see no reason to have the
> callers compute the dependencies out of line, you just need to pass
> the target (this) down to applyConstraint.
>
> On 2007-10-16, at 16:40 EDT, P T Withington wrote:
>
> > Not approved.
> >
> > 1) This code should be modeled on the known-working code in LzNode:
> >
> >> if (rp instanceof Function && ('dependencies' in rp)) {
> >> this.applyConstraint( p , rp , rp.dependencies.call
> >> (this) );
> >> }
> >
> > rather than creating the mystery `_t` attribute.
> >
> > 2) There seems to be another branch of the code that replicates the
> > same bug which should also be rewritten in modern style.
> >
> > 3) What about the case of a $once constraint? Will it be handled
> > correctly? In LzNode when there are no dependencies, the
> > constraint function is still called at least once. I don't see in
> > this code where that is handled.
> >
> > On 2007-10-16, at 15:24 EDT, Henry Minsky wrote:
> >
> >> Change 20071016-hqm-4 by hqm at IBM-2E06404CB67 on 2007-10-16
> >> 15:19:46 EDT
> >> in /cygdrive/c/users/hqm/openlaszlo/trunk
> >> for http://svn.openlaszlo.org/openlaszlo/trunk
> >>
> >> Summary: fix for DHTML replication bug
> >>
> >> New Features:
> >>
> >> Bugs Fixed: LPP-4893
> >>
> >> Technical Reviewer: andre
> >> QA Reviewer: ptw
> >> Doc Reviewer:
> >>
> >> Documentation:
> >>
> >> check for null dependencies function before calling it
> >>
> >> Release Notes:
> >>
> >> Details:
> >>
> >>
> >> Tests:
> >>
> >> test case from bug, smokecheck, amazon app
> >>
> >> Files:
> >> M WEB-INF/lps/lfc/data/LzReplicationManager.lzs
> >>
> >> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071016-
> >> hqm-4.tar
> >>
> >>
> >> --
> >> Henry Minsky
> >> Software Architect
> >> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
> >
>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>
More information about the Laszlo-dev
mailing list