Posted by
bobcalco on
Jan 27, 2012; 12:15pm
URL: https://forum.world.st/Tutorial-bug-with-preferedUrl-tp4332983p4333281.html
Another point. :)
I don't like that "URLResolver default changeToPreferedURL:" requires
a domain object to implement preferedUrl.
URLResolver changeToPreferredURL should take a "plain ol'" domain
object -- say, MyDomainObject -- and look for a corresponding
MyDomainObjectApp (as happens anyway in the view subsystem). Then it
should call MyDomainObjectApp>>preferredUrlFor: aMyDomainObject. It's
the app's job to know about URLs, not the domain object's, in my
opinion.
Not finding a MyDomainObjectApp>>preferredUrlFor: aMyDomainObject, it
could then just default to the current naming scheme.
This is an interesting area in general as I like the RESTful way of
nesting resources. Such nesting can get out of hand if taken too
deeply but in any case this kind of thing needs to be negotiated
between Apps (whose nesting can be implied by the relationships
between domain objects, really) and not in any way codified in the
domain objects themselves.
This is where a metadata framework like Magritte for Seaside would
come in handy in Aida. :)
- Bob
On Jan 27, 10:08 am, Robert Calco <
[hidden email]> wrote:
> I have implemented the Aida tutorial but notice a quirk when adding new
> entries, namely, the URL of the new object is always "-c". For example, if
> you add 'Jack', 'Beanstalk', '1234567890', '
[hidden email]', the URL of
> the new entity is '/address/-c'. It seems to me it should generate
> correctly the URL '/address/beanstalk' instead.
>
> In order to fix the situation I have to run
>
> book addresses do: [ :each | URLResolver default changeToPreferedURL: each
> ].
>
> ... (fortunately I have the 'book' reference in my transcript which I don't
> dare lose). Then everybody's URL is right.
>
> - Bob
>
> _______________________________________________
> Aida mailing list
>
[hidden email]://lists.aidaweb.si/mailman/listinfo/aida
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida