Forum OpenACS Q&A: Re: url abstraction

Collapse
16: Re: url abstraction (response to 15)
Posted by Dirk Gomez on
https://openacs.org/some-magic-number is vastly superior to https://openacs.org/forums/forum-view/14013, because it will survive site-map renaming adventures.

We already had that discussion, hadn't we?

My two cents: if we go for URL abstration let's shoot for "some-magic-number" and give the user the option to include the locale: https://openacs.org/de_AT/some-magic-number might just be different from https://openacs.org/de_de/some-magic-number might

Collapse
17: Re: url abstraction (response to 16)
Posted by Tom Jackson on

Assuming the transformation between "forums/forum-view/14013/" and "some-magic-mumber" is reversable, you will still run into a problem whenever you decide to change any of the url, such as the mount point. Any change would still require some kind of mapping to track the change.

As long as the magic number is only calculated in one place, the problem is minor, however what if you want links from one page to another, then "../" which could serve as link location has to be normalized and transformed. Any page providing a list of links will need to do multiple transformations, and these may need to be done in an expensive way, running db_foreach or db_multirow with a script block.

But for flat navigation structures, removing a bunch of ugly query vars, or making a tiny url, I like the concept very much. Both methods are possible with OpenACS, and the choice is probably going to remain application dependent. The transform could also only apply to _a part_ of a url, allowing you to condense several query vars with values into one neat string.