Trails

Collection Semantics for EditPage miss the mark - not natural

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.0
  • Fix Version/s: 1.2.0
  • Component/s: trails-core
  • Labels:
    None
  • Environment:
    XP Pro, apache-maven-2.0.8, eclipse-3.3.1.1, jre-1.5.0_14, ognl-2.7.3-SNAPSHOT, tapestry-4.1.6-SNAPSHOT , MySQL-5.0.45
  • Number of attachments :
    0

Description

Collection Semantics for EditPage miss the mark - not natural

EditPage.JAVA
public boolean cameFromCollection()
{ return getParent() != null; }

All the above method characterizes is that the page is referenced by a delegate page. Has nothing to do with collection. And it seems reasonable to state that it would only be useful for the root case.

Granted, yes trails may need to check for this.

But more checks are warranted, like a real natural check for collection or a reference?

Here is an appropriate implementation

// the patch
public boolean cameFromCollection()
{ return (getAssociationDescriptor() instanceof CollectionDescriptor); }

// optional
public boolean isReferencedByParentPage()
{ return getParent() != null; } }

These aspects can be worked into the dependent logic as needed

Activity

Hide
Ken in nashua added a comment -

Actually, the patch works beautifully as-is compatible to existing logic.

It also serves my personal implementation of

http://jira.codehaus.org/browse/TRAILS-129

whose title should be changed to "ObjectReferenceDescriptor needs to support inverse"

I have the sweetest implementation of trails runniing.

Show
Ken in nashua added a comment - Actually, the patch works beautifully as-is compatible to existing logic. It also serves my personal implementation of http://jira.codehaus.org/browse/TRAILS-129 whose title should be changed to "ObjectReferenceDescriptor needs to support inverse" I have the sweetest implementation of trails runniing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: