[web-devel] A separation of concerns
jeremy at n-heptane.com
Mon Mar 15 17:58:50 EDT 2010
On Mon, Mar 15, 2010 at 4:23 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> Hi Chris,
> > - a good URL routing library (where you can only produce and link to
> valid urls)
> Think about this twice: You can't recompile bigger CMS systems each time
> you add a link.
What do you mean by 'adding a link' in a bigger CMS. To me that sounds like
something which is done by a user interacting with the app via the browser?
I don't see that as being in conflict with producing only valid urls... It
seems like the system would have two classes of URLs. Ones that are
statically known at compile time, and ones that only exist due to the state
of the live database.
If you want to add new code that refers to a specific page that was created
in the live database -- then you do have a potential issue, since you can
not guarantee at compile time that the dynamically created page will exactly
The URL routing library ensures that when you are referring to 'static' urls
in your code, you only generate valid urls. And the app runtime ensures that
dynamically created urls are valid. And when you want to have static code
which refers to a page which may or may not exist.. you can still probably
benefit from a good URL router..
data CmsUrl =
| DynLink String
do u <- showURL ASpecificDynamicLink
cms :: CmsURL -> URLT CmrURL IO ()
cms LoginPage = ....
cms Homepage = ...
cms ASpecificDynamicLink = cms (Dynlink "somelink")
cms (DynLink str) = ...
What am I missing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel